Difference between revisions of "TEST-STRCMP4CODES"

From SimsWiki
Jump to: navigation, search
Line 1: Line 1:
define LotSkirtWater()
+
#
material    
+
# deck/foundation material definitions.
create DetermineHardwareSupport()
+
#
  
if ($useHWShader2Path)
+
# material for roof preview when they're displayed
create LotSkirtPSWater()
+
define DeckFoundationPreviewMaterial()
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
 
   material
      # fallback: no reflection.
+
       shader -layer 9991
       shader -layer ($nhoodWaterLayer)
+
         vertexFormatPred position      0 true
         viewerRenderTypePred viewerRenderType
+
         vertexFormatPred normal        0 true
          
+
         vertexFormatPred blendindices  0 false
         create DetermineHardwareSupport()
+
         vertexFormatPred targetindices 0 false
          
+
 
         pass -fixedFunction
+
         pass -fixedFunction        
  # For now, we are diabling the lighting since we simply want to use the vertex colors.
+
            colorScalar $baseColor       
  create LightingStatesNoStdLightsParam(false true)
+
            create LightingStatesNoStdLights()
  alphaBlend srcFactor(srcAlpha) add dstFactor(invSrcAlpha)
+
            depthTest true -enableDepthWrite true
 
+
 
            colorScalar (.4, .6, .9, .4)     
+
            alphaBlend srcFactor(srcAlpha) add dstFactor(invSrcAlpha)
           
+
 
            #tring to remove warble I think it may be caused by depth bias.
+
            #ffDepthOffset -2                             
+
           
+
            fillmode $stdMatFillMode
+
 
             stage
 
             stage
               #texture reflectionoutdoorwater-envcube
+
               textureBlend select(colorScalar) select(colorScalar)
              if ($cubeMapSupport)
+
            end
                  texture $skyboxCubeMap
+
        end
                  textureMIPFilterHint disabled
+
  
                  ffTextureCoordsSource fromReflectionVector
+
        pass -fixedFunction       
                  ffTextureMatrix -orientCameraToGlobal
+
            create LightingStatesNoStdLights()
 +
            fillmode wireframe
 +
            cullmode none
 +
            depthTest true -enableDepthWrite false
 +
            colorScalar (0, 0, 0)
 +
 
 +
            stage
 +
              textureBlend select(colorScalar) select(colorScalar)
 +
            end
 +
        end
  
                  textureAddressing clamp clamp clamp
 
                  textureBlend multiply(texture colorScalar) select(colorScalar)
 
              else
 
                  textureBlend select(colorScalar) multiply(diffuse colorScalar)
 
              endif
 
            end 
 
        end 
 
 
       end
 
       end
   end              
+
   end
 
enddef
 
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
+
materialDefinition DeckFoundationPreviewPlaceable
   addParam wmXRepeat      5
+
   setDefinition DeckFoundationPreviewMaterial
   addParam wmXWaveHeight  0.001
+
   addParam baseColor (0.5, 0.5, 0.0, 0.5)
 
+
  addParam wmYSpeed        3
+
  addParam wmYRepeat      6
+
  addParam wmYWaveHeight  0.001
+
 
+
 
end
 
end
  
materialDefinition lotSkirtSeaNoReflection
+
materialDefinition DeckFoundationPreviewNotPlaceable
   setDefinition LotSkirtWaterNoReflection 
+
   setDefinition DeckFoundationPreviewMaterial
 +
  addParam baseColor (1.0, 0.0, 0.0, 0.5)
 
end
 
end

Revision as of 06:20, 7 September 2007

  1. deck/foundation material definitions.
  1. material for roof preview when they're displayed

define DeckFoundationPreviewMaterial()

  material
     shader -layer 9991
        vertexFormatPred position      0 true
        vertexFormatPred normal        0 true
        vertexFormatPred blendindices  0 false
        vertexFormatPred targetindices 0 false
        pass -fixedFunction         
           colorScalar $baseColor         
           create LightingStatesNoStdLights()
           depthTest true -enableDepthWrite true
           alphaBlend srcFactor(srcAlpha) add dstFactor(invSrcAlpha)		
           stage
              textureBlend select(colorScalar) select(colorScalar)
           end 
        end
        pass -fixedFunction        
           create LightingStatesNoStdLights()
           fillmode wireframe
           cullmode none
           depthTest true -enableDepthWrite false
           colorScalar (0, 0, 0)
           stage
              textureBlend select(colorScalar) select(colorScalar)
           end 
        end
     end
  end

enddef


materialDefinition DeckFoundationPreviewPlaceable

  setDefinition DeckFoundationPreviewMaterial
  addParam baseColor (0.5, 0.5, 0.0, 0.5)

end

materialDefinition DeckFoundationPreviewNotPlaceable

  setDefinition DeckFoundationPreviewMaterial
  addParam baseColor (1.0, 0.0, 0.0, 0.5)

end

Personal tools
Namespaces

Variants
Actions
Navigation
game select
Toolbox