TEST-STRCMP4CODES
From SimsWiki
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