Difference between revisions of "TEST-STRCMP4CODES"
From SimsWiki
| Line 1: | Line 1: | ||
material | material | ||
| + | # This material updates a render target with the current frame | ||
| + | # of the tile animation. This is the only way to handle a repeated | ||
| + | # animating texture (not to mention using it for projective texturing) | ||
| + | # in the absence of clip maps. | ||
create DetermineHardwareSupport() | create DetermineHardwareSupport() | ||
| Line 9: | Line 13: | ||
pass | pass | ||
renderClipSpaceRect | renderClipSpaceRect | ||
| + | |||
renderTarget causticsTile -fixed (64, 64) -allocateDepthBuffer false -undo | renderTarget causticsTile -fixed (64, 64) -allocateDepthBuffer false -undo | ||
| − | create | + | |
| + | create TiledTextureAnimShaderProgram(8 4 1) | ||
alphaBlend srcFactor(one) add dstFactor(zero) | alphaBlend srcFactor(one) add dstFactor(zero) | ||
| Line 19: | Line 25: | ||
depthTestFunction accept | depthTestFunction accept | ||
| − | + | # 7/24/2004 Fix bug with kRenderTypeNormal default stencil state and nv40. | |
| + | # It reads random stencil values even this target has no depth stencil target. | ||
| + | # This stencil call will break pixo, but pixo does not show caustics. | ||
| + | stencil false | ||
fillmode $stdMatFillMode | fillmode $stdMatFillMode | ||
Revision as of 03:35, 3 September 2007
material
# This material updates a render target with the current frame
# of the tile animation. This is the only way to handle a repeated
# animating texture (not to mention using it for projective texturing)
# in the absence of clip maps.
create DetermineHardwareSupport()
if ($causticsEnabled and $useFixedFunctionPath = false and $useSWVertexShaderPath = false)
shader -layer +9999
pass
renderClipSpaceRect
renderTarget causticsTile -fixed (64, 64) -allocateDepthBuffer false -undo
create TiledTextureAnimShaderProgram(8 4 1)
alphaBlend srcFactor(one) add dstFactor(zero)
alphaTest false 0
alphaTestFunction acceptIfGreater
depthTest false -enableDepthWrite false
depthTestFunction accept
# 7/24/2004 Fix bug with kRenderTypeNormal default stencil state and nv40.
# It reads random stencil values even this target has no depth stencil target.
# This stencil call will break pixo, but pixo does not show caustics.
stencil false
fillmode $stdMatFillMode
shaderProgram -target pixelProgram -method compile -version 1_1
shaderSource
sampler caustics;
struct cInputPixel
{
float4 color : COLOR;
float2 tc0 : TEXCOORD0;
};
float4 PixelMain(cInputPixel pi) : COLOR
{
float4 texColor = tex2D(caustics, pi.tc0);
return texColor*pi.color;
}
endShaderSource
end
sampler 0
texture causticsTiled
textureAddressing tile tile
end
end
end
else
shader
end
endif
end
enddef
setf causticsStrength 0.8 setf causticsBaseStrength 0.5