Difference between revisions of "TEST-STRCMP4CODES"

From SimsWiki
Jump to: navigation, search
Line 1: Line 1:
EP3-OFB
+
EP6-BV
 
0xCD7FE87A
 
0xCD7FE87A
 
0x1C0532FA
 
0x1C0532FA
0xB00AEAC0
+
0xE55E5272
0xFF7D973E
+
0xFF8281EB
# rug
+
# fight
  
 
+
#
##############################################################
+
# Materials related to fight FX
# Rugs
+
 
#
 
#
  
seti rugLayer -2
 
setb forceFF false
 
setb hasShapeColor false
 
  
define RugMaterialFF()
+
materialDefinition fightCenterHemisphere
   material
+
   setDefinition CubeAlphaFalloffTexture
      shader -layer $rugLayer       
+
  addParam stdMatLayer 17
 +
  addParam stdMatEnvCubeTextureName steamSphere_alphaFalloff5
 +
  addParam stdMatBaseTextureName fightcenterhemisphere-alpha
 +
end
  
        if ($hasShapeColor)       
+
materialDefinition fightDustPop
            pass -fixedFunction -modifiedEachFrameHint
+
  setDefinition StandardMaterial
        else
+
  addParam stdMatLayer 5
            pass -fixedFunction
+
  addParam stdMatLightingEnabled false
        endif
+
  addParam stdMatAlphaBlendMode blend
       
+
  addParam stdMatAlphaTestEnabled false
            create LightingStates()
+
  addParam stdMatAlphaMultiplier  0.2
            create AttenuatedMatCoef(1)                     
+
  addParam stdMatBaseTextureAlphaReplicate true
                   
+
  addParam stdMatDiffCoef (1, 1, 0.8)
                             
+
  addParam stdMatBaseTextureEnabled true
            ffDepthOffset 2          
+
  addParam stdMatBaseTextureName brokenLampSmoke
           
+
  addParam stdMatEmissiveCoef (1, 1, 1)
            alphaTest true 127
+
  addParam stdMatBaseTextureAddressingU clamp
            alphaTestFunction acceptIfGreater
+
  addParam stdMatBaseTextureAddressingV clamp
            depthTest true -enableDepthWrite false                       
+
end
           
+
            colorScalar (0.8, 0.8, 0.8, 1)
+
           
+
            if ($hasShapeColor)
+
              tsEdithShapeColor $currentMaterialName
+
             
+
              stage
+
                  texture $rugTexture
+
                  ffTextureCoordsSource 0
+
                  # add the lightmap lighting to any direct lights.
+
  # the light map has been prescaled by 0.5
+
  textureBlend multiply(texture colorScalar) select(texture)
+
              end
+
             
+
            else
+
                                                     
+
              stage
+
                  texture "floorLightMap_${page}"
+
                  ffTextureCoordsSource 1
+
                  # add the lightmap lighting to any direct lights.
+
  # the light map has been prescaled by 0.5
+
  textureBlend multiply(texture colorScalar) select(texture)
+
              end
+
                                                           
+
              stage
+
                  texture $rugTexture
+
                  textureAddressing clamp clamp
+
                  ffTextureCoordsSource 0
+
  textureBlend multiplyScale2(texture outRegister) select(texture)
+
              end #end stage             
+
            endif           
+
                       
+
        end #pass     
+
      end #end shader 
+
  end #end material
+
enddef
+
  
setv3 matdiffuse (0.8, 0.8, 0.8)
+
materialDefinition fightGroundHemisphere
 +
  setDefinition CubeAlphaFalloffTexture
 +
  addParam stdMatLayer 13
 +
  addParam stdMatEnvCubeTextureName steamSphere_alphaFalloff5
 +
  addParam stdMatBaseTextureName fightcenterhemisphere-alpha
 +
end
  
define RugMaterialGen()
+
materialDefinition fighteffectsregistrationgrid_green
   material     
+
   setDefinition StandardMaterial
      create DetermineHardwareSupport()       
+
   addParam stdMatAlphaBlendMode none
     
+
   addParam stdMatAlphaMultiplier 1.000000
      #trace "$currentMaterialName : $forceFF"
+
   addParam stdMatAlphaRefValue 127
     
+
   addParam stdMatAlphaTestEnabled 0
      if (not $hasShapeColor and ($useHWShader1Path or $useHWShader2Path))
+
   addParam stdMatBaseTextureAlphaReplicate 0
        create RugMaterialHW()
+
   addParam stdMatDiffCoef 0.021,1,0
      else
+
   addParam stdMatFillMode solid
        create RugMaterialFF()
+
  addParam stdMatLayer 0
 
+
   addParam stdMatLightingEnabled 0
        # ultimate fallback pass? no light map, one stage.
+
  addParam stdMatMinLightRangeHint 4
  shader -layer $rugLayer
+
  validateRenderShaderContext -vertexFormat position 0 required
+
  validateRenderShaderContext -vertexFormat normal 0 required
+
  validateRenderShaderContext -vertexFormat texcoord 0 required  
+
 
+
  pass -fixedFunction
+
  create LightingStates()
+
  create AttenuatedMatCoef(1)
+
 
+
  ffDepthOffset 2                       
+
              alphaTest true 127
+
              alphaTestFunction acceptIfGreater
+
              depthTest true -enableDepthWrite false                       
+
 
+
  stage
+
  texture $rugTexture
+
  textureAddressing clamp clamp
+
  ffTextureCoordsSource 0
+
  textureBlend multiplyScale2(texture diffuse) select(outRegister)
+
  end
+
  end
+
end
+
      endif
+
   end # material
+
enddef
+
 
+
define RugMaterialHW()
+
   shader -layer $rugLayer
+
      validateRenderShaderContext -vertexFormat position 0 required
+
      validateRenderShaderContext -vertexFormat texcoord 0 required       
+
     
+
      pass
+
        alphaTest true 127
+
        alphaTestFunction acceptIfGreater
+
depthTest true -enableDepthWrite false
+
depthTestFunction acceptIfLess
+
             
+
        shaderProgram -target vertexProgram -method compile -version 1_1
+
            bindConstants 0 -bindingID geomToCamera -constantCount 3
+
            bindConstants 3 -bindingID cameraToClipWithDepthOffset -constantCount 4 -data(2, 2, 2, 2)
+
           
+
            shaderSource
+
              float4x3 geomToCameraMatrix  : register(c0);                 
+
              float4x4 cameraToClipWithDOMatrix : register(c3);
+
             
+
              struct cVertexIn
+
              {
+
                  float3 mPosition : POSITION0; 
+
                  float2 mTC0 : TEXCOORD0;                 
+
                  float2 mTC1 : TEXCOORD1;
+
              };
+
             
+
              struct cVertexOut
+
              {
+
                  float4 mClipPosition : POSITION;                   
+
                  float2 mTC0 : TEXCOORD0;
+
                  float2 mTC1 : TEXCOORD1;
+
              };
+
             
+
              cVertexOut VertexMain(cVertexIn vertexIn)
+
              {               
+
                  cVertexOut result;                                                                       
+
                  float3 pos = mul(float4(vertexIn.mPosition, 1), geomToCameraMatrix);
+
                  result.mClipPosition = mul(float4(pos, 1), cameraToClipWithDOMatrix);                   
+
                  result.mTC0 = vertexIn.mTC0;
+
                  result.mTC1 = vertexIn.mTC1;
+
                  return result;       
+
              }
+
             
+
            endShaderSource
+
        end 
+
 
+
        shaderProgram -target pixelProgram -method assemble
+
            bindConstants 0 -bindingID immediateData -data($matdiffuse, 1)
+
           
+
            shaderSource
+
              ps_1_1
+
              def c2, 1,1,1,1
+
              tex t0 ; base
+
              tex t1 ; lightmap
+
             
+
              mul r0, t0, t1  ; base floor * light map                             
+
              mul_x2 r0.rgb, r0, c0 ; scale at the end to prevent precision/LDR errors
+
              mov r0.a, t0.a             
+
            endShaderSource
+
        end # end shader program
+
                   
+
        sampler 0
+
            texture $rugTexture
+
            textureAddressing clamp clamp
+
        end
+
       
+
        sampler 1
+
texture "floorLightMap_${page}"
+
end
+
      end
+
   end 
+
enddef
+
 
+
materialDefinition RugMaterial
+
   addParam rugTexture rug
+
   addParam page 0
+
   addParam stdMatDiffCoef (0.8, 0.8, 0.8)
+
   addParam stdMatSpecPower 0
+
   addParam stdMatEmissiveCoef 0,0,0
+
 
   addParam stdMatSpecCoef 0,0,0
 
   addParam stdMatSpecCoef 0,0,0
   setDefinition RugMaterialGen
+
   addParam stdMatUntexturedDiffAlpha 1
 
end
 
end
  
materialDefinition RugMaterialEdithColor
+
materialDefinition fighteffectsregistrationgrid_red
   addParam rugTexture rug
+
  setDefinition StandardMaterial
   addParam page 0
+
   addParam stdMatAlphaBlendMode none
   addParam stdMatDiffCoef (0.8, 0.8, 0.8)
+
   addParam stdMatAlphaMultiplier 1.000000
  addParam stdMatSpecPower 0
+
  addParam stdMatAlphaRefValue 127
 +
  addParam stdMatAlphaTestEnabled 0
 +
   addParam stdMatBaseTextureAlphaReplicate 0
 +
  addParam stdMatDiffCoef 1,0.12,0
 
   addParam stdMatEmissiveCoef 0,0,0
 
   addParam stdMatEmissiveCoef 0,0,0
 +
  addParam stdMatFillMode solid
 +
  addParam stdMatLayer 0
 +
  addParam stdMatLightingEnabled 0
 +
  addParam stdMatMinLightRangeHint 4
 
   addParam stdMatSpecCoef 0,0,0
 
   addParam stdMatSpecCoef 0,0,0
   addParam hasShapeColor true
+
   addParam stdMatUntexturedDiffAlpha 1
  setDefinition RugMaterialGen
+
end
end
+

Revision as of 03:29, 7 September 2007

EP6-BV 0xCD7FE87A 0x1C0532FA 0xE55E5272 0xFF8281EB

  1. fight
  1. Materials related to fight FX


materialDefinition fightCenterHemisphere

  setDefinition CubeAlphaFalloffTexture
  addParam stdMatLayer 17
  addParam stdMatEnvCubeTextureName steamSphere_alphaFalloff5
  addParam stdMatBaseTextureName fightcenterhemisphere-alpha

end

materialDefinition fightDustPop

  setDefinition StandardMaterial
  addParam stdMatLayer 5
  addParam stdMatLightingEnabled false
  addParam stdMatAlphaBlendMode blend
  addParam stdMatAlphaTestEnabled false
  addParam stdMatAlphaMultiplier  0.2
  addParam stdMatBaseTextureAlphaReplicate true
  addParam stdMatDiffCoef (1, 1, 0.8)
  addParam stdMatBaseTextureEnabled true
  addParam stdMatBaseTextureName brokenLampSmoke
  addParam stdMatEmissiveCoef (1, 1, 1)
  addParam stdMatBaseTextureAddressingU clamp
  addParam stdMatBaseTextureAddressingV clamp

end

materialDefinition fightGroundHemisphere

  setDefinition CubeAlphaFalloffTexture
  addParam stdMatLayer 13
  addParam stdMatEnvCubeTextureName steamSphere_alphaFalloff5
  addParam stdMatBaseTextureName fightcenterhemisphere-alpha

end

materialDefinition fighteffectsregistrationgrid_green

  setDefinition StandardMaterial
  addParam stdMatAlphaBlendMode none
  addParam stdMatAlphaMultiplier 1.000000
  addParam stdMatAlphaRefValue 127
  addParam stdMatAlphaTestEnabled 0
  addParam stdMatBaseTextureAlphaReplicate 0
  addParam stdMatDiffCoef 0.021,1,0
  addParam stdMatFillMode solid
  addParam stdMatLayer 0
  addParam stdMatLightingEnabled 0
  addParam stdMatMinLightRangeHint 4
  addParam stdMatSpecCoef 0,0,0
  addParam stdMatUntexturedDiffAlpha 1

end

materialDefinition fighteffectsregistrationgrid_red

  setDefinition StandardMaterial
  addParam stdMatAlphaBlendMode none
  addParam stdMatAlphaMultiplier 1.000000
  addParam stdMatAlphaRefValue 127
  addParam stdMatAlphaTestEnabled 0
  addParam stdMatBaseTextureAlphaReplicate 0
  addParam stdMatDiffCoef 1,0.12,0
  addParam stdMatEmissiveCoef 0,0,0
  addParam stdMatFillMode solid
  addParam stdMatLayer 0
  addParam stdMatLightingEnabled 0
  addParam stdMatMinLightRangeHint 4
  addParam stdMatSpecCoef 0,0,0
  addParam stdMatUntexturedDiffAlpha 1
end
Personal tools
Namespaces

Variants
Actions
Navigation
game select
Toolbox