module Graphics.LambdaCube.Technique where import Graphics.LambdaCube.RenderSystemCapabilities import Graphics.LambdaCube.Pass import Graphics.LambdaCube.Texture import Graphics.LambdaCube.GpuProgram -- | illumination pass state type data IlluminationPassesState = IPS_COMPILE_DISABLED | IPS_NOT_COMPILED | IPS_COMPILED deriving Eq {-| Directive used to manually control technique support based on the inclusion or exclusion of some factor. -} data IncludeOrExclude = INCLUDE -- ^ Inclusive - only support if present | EXCLUDE -- ^ Exclusive - do not support if present deriving Eq -- | Rule controlling whether technique is deemed supported based on GPU vendor data GPUVendorRule = GPUVendorRule { gvrVendor :: GPUVendor , gvrIncludeOrExclude :: IncludeOrExclude } deriving Eq -- | Rule controlling whether technique is deemed supported based on GPU device name data GPUDeviceNameRule = GPUDeviceNameRule { gdrDevicePattern :: String , gdrIncludeOrExclude :: IncludeOrExclude , gdrCaseSensitive :: Bool } deriving Eq {-| Class representing an approach to rendering this particular Material. @remarks Ogre will attempt to use the best technique supported by the active hardware, unless you specifically request a lower detail technique (say for distant rendering). -} data (Texture t, LinkedGpuProgram lp) => Technique t lp = Technique { tchPasses :: [Pass t lp] -- ^ List of primary passes -- , tchIlluminationPasses :: [IlluminationPass] -- ^ List of derived passes, categorised into IlluminationStage (ordered) -- , tchIsSupported :: Bool -- IlluminationPassesState mIlluminationPassesCompilationPhase; , tchLodIndex :: Int -- ^ LOD level {-| Scheme index, derived from scheme name but the names are held on MaterialManager, for speed an index is used here. -} , tchSchemeIndex :: Int , tchName :: String -- ^ optional name for the technique {-| When casting shadow, if not using default Ogre shadow casting material, or nor using fixed function casting, mShadowCasterMaterial let you customize per material shadow caster behavior -} -- , tchShadowCasterMaterial :: Material {-| When casting shadow, if not using default Ogre shadow casting material, or nor using fixed function casting, mShadowCasterMaterial let you customize per material shadow caster behavior.There only material name is stored so that it can be loaded once all file parsed in a resource group. -} -- , tchShadowCasterMaterialName :: String {-| When receiving shadow, if not using default Ogre shadow receiving material, or nor using fixed function texture projection receiving, mShadowReceiverMaterial let you customize per material shadow caster behavior -} -- , tchShadowReceiverMaterial :: Material {-| When receiving shadow, if not using default Ogre shadow receiving material, or nor using fixed function texture projection receiving, mShadowReceiverMaterial let you customize per material shadow caster behavior. There only material name is stored so that it can be loaded once all file parsed in a resource group. -} -- , tchShadowReceiverMaterialName :: String , tchGPUVendorRules :: [GPUVendorRule] , tchGPUDeviceNameRules :: [GPUDeviceNameRule] }