TEST-STRCMP4CODES

From SimsWiki
Revision as of 06:15, 7 September 2007 by Niol (Talk | contribs)

Jump to: navigation, search

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

materialDefinition lotSkirtSea

  setDefinition LotSkirtWater  
  addParam stdMatLightingEnabled false
  addParam stdMatLayer 0
  
  addParam stdMatDiffCoef (1, 1, 1)   
  addParam wmReflectionTexture swimming_pool-envcube
  addParam wmTransparency 0.4
  addParam wmXSpeed        3
  addParam wmXRepeat       5
  addParam wmXWaveHeight   0.001 
  
  addParam wmYSpeed        3
  addParam wmYRepeat       6
  addParam wmYWaveHeight   0.001 
 

end

materialDefinition lotSkirtSeaNoReflection

  setDefinition LotSkirtWaterNoReflection   

end

Personal tools
Namespaces

Variants
Actions
Navigation
game select
Toolbox