Difference between revisions of "TEST-STRCMP4CODES"
| Line 1: | Line 1: | ||
| − | + | define LotSkirtWater() | |
| − | + | material | |
| − | + | create DetermineHardwareSupport() | |
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | if ($useHWShader2Path) | |
| − | + | create LotSkirtPSWater() | |
| − | textureAddressing clamp clamp | + | else |
| − | + | ||
| − | + | shader -layer $nhoodWaterLayer | |
| − | texture | + | validateRenderShaderContext -vertexFormat position 0 required |
| − | + | validateRenderShaderContext -vertexFormat normal 0 required | |
| − | + | validateRenderShaderContext -vertexFormat texcoord 0 required | |
| − | + | viewerRenderTypePred viewerRenderType | |
| − | + | ||
| + | pass -fixedFunction | ||
| + | |||
| + | alphaBlend srcFactor(srcAlpha) add dstFactor(invSrcAlpha) | ||
| + | colorScalar $lotSkirtWaterReflColour 0.50 | ||
| + | depthTest true -enableDepthWrite false | ||
| + | |||
| + | #tring to remove warble I think it may be caused by depth bias. | ||
| + | #ffDepthOffset -2 | ||
| + | |||
| + | stage | ||
| + | ffTextureCoordsSource fromPosition | ||
| + | ffTextureMatrix -cameraToClip -scalev ((-0.5 * $ratioW), (-0.5 * $ratioH)) -trans (0.5, 0.5) | ||
| + | textureAddressing clamp clamp | ||
| + | texture "ScreenReflection" | ||
| + | |||
| + | textureBlend multiply(texture colorScalar) multiply(diffuse colorScalar) | ||
| + | end | ||
| + | |||
| + | end | ||
| + | end | ||
| + | endif | ||
| + | end | ||
| + | enddef | ||
| + | |||
| + | define LotSkirtWaterNoReflection() | ||
| + | material | ||
| + | # fallback: no reflection. | ||
| + | shader -layer ($nhoodWaterLayer) | ||
| + | viewerRenderTypePred viewerRenderType | ||
| + | |||
| + | create DetermineHardwareSupport() | ||
| + | |||
| + | pass -fixedFunction | ||
| + | # For now, we are diabling the lighting since we simply want to use the vertex colors. | ||
| + | create LightingStatesNoStdLightsParam(false true) | ||
| + | alphaBlend srcFactor(srcAlpha) add dstFactor(invSrcAlpha) | ||
| + | |||
| + | colorScalar (.4, .6, .9, .4) | ||
| + | |||
| + | #tring to remove warble I think it may be caused by depth bias. | ||
| + | #ffDepthOffset -2 | ||
| + | |||
| + | fillmode $stdMatFillMode | ||
| + | stage | ||
| + | #texture reflectionoutdoorwater-envcube | ||
| + | if ($cubeMapSupport) | ||
| + | texture $skyboxCubeMap | ||
| + | textureMIPFilterHint disabled | ||
| + | |||
| + | ffTextureCoordsSource fromReflectionVector | ||
| + | ffTextureMatrix -orientCameraToGlobal | ||
| + | |||
| + | textureAddressing clamp clamp clamp | ||
| + | textureBlend multiply(texture colorScalar) select(colorScalar) | ||
| + | else | ||
| + | textureBlend select(colorScalar) multiply(diffuse colorScalar) | ||
| + | endif | ||
| + | end | ||
| + | end | ||
| + | end | ||
| + | end | ||
enddef | enddef | ||
Revision as of 11:12, 7 September 2007
define LotSkirtWater() material create DetermineHardwareSupport()
if ($useHWShader2Path) create LotSkirtPSWater() else
shader -layer $nhoodWaterLayer validateRenderShaderContext -vertexFormat position 0 required validateRenderShaderContext -vertexFormat normal 0 required validateRenderShaderContext -vertexFormat texcoord 0 required viewerRenderTypePred viewerRenderType
pass -fixedFunction
alphaBlend srcFactor(srcAlpha) add dstFactor(invSrcAlpha) colorScalar $lotSkirtWaterReflColour 0.50 depthTest true -enableDepthWrite false
#tring to remove warble I think it may be caused by depth bias. #ffDepthOffset -2
stage ffTextureCoordsSource fromPosition ffTextureMatrix -cameraToClip -scalev ((-0.5 * $ratioW), (-0.5 * $ratioH)) -trans (0.5, 0.5) textureAddressing clamp clamp texture "ScreenReflection"
textureBlend multiply(texture colorScalar) multiply(diffuse colorScalar) end
end end endif
end
enddef
define LotSkirtWaterNoReflection()
material
# fallback: no reflection.
shader -layer ($nhoodWaterLayer)
viewerRenderTypePred viewerRenderType
create DetermineHardwareSupport()
pass -fixedFunction
# For now, we are diabling the lighting since we simply want to use the vertex colors. create LightingStatesNoStdLightsParam(false true) alphaBlend srcFactor(srcAlpha) add dstFactor(invSrcAlpha)
colorScalar (.4, .6, .9, .4)
#tring to remove warble I think it may be caused by depth bias.
#ffDepthOffset -2
fillmode $stdMatFillMode
stage
#texture reflectionoutdoorwater-envcube
if ($cubeMapSupport)
texture $skyboxCubeMap
textureMIPFilterHint disabled
ffTextureCoordsSource fromReflectionVector
ffTextureMatrix -orientCameraToGlobal
textureAddressing clamp clamp clamp
textureBlend multiply(texture colorScalar) select(colorScalar)
else
textureBlend select(colorScalar) multiply(diffuse colorScalar)
endif
end
end
end
end
enddef