Difference between revisions of "TEST-STRCMP4CODES"
| Line 1: | Line 1: | ||
| + | EP6-BV | ||
| + | 0xCD7FE87A | ||
| + | 0x1C0532FA | ||
| + | 0x8674B810 | ||
| + | 0xFF9F1489 | ||
| + | # glow | ||
| − | # | + | # |
| − | # | + | # |
| − | # | + | # |
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | # Used for glow/steam effects: transparency falls off at edges | |
| − | + | # of object. (Camera-relative normal looks up into a cube map.) | |
| − | + | define CubeAlphaFalloff() | |
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | # | + | |
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | define | + | |
material | material | ||
attributes | attributes | ||
| − | attribute | + | attribute steamRGB float3 |
| − | attribute | + | attribute steamAlpha float1 |
| − | + | ||
end | end | ||
| Line 73: | Line 26: | ||
vertexFormatPred targetindices 0 false | vertexFormatPred targetindices 0 false | ||
| − | + | create DetermineHardwareSupport() | |
| − | + | ||
| − | + | if ($useFixedFunctionPath or $useSWVertexShaderPath) | |
| − | + | pass -fixedFunction | |
| − | + | create LightingStatesNoStdLightsParam(true false) | |
| − | + | alphaBlend srcFactor(srcAlpha) add dstFactor(one) | |
| − | + | depthTest true -enableDepthWrite false | |
| − | + | ffMatCoef -amb (1,1,1) -diff (1,1,1) -emit (0,0,0) -spec (0,0,0) -specPow 0 | |
| − | + | colorScalar $stdMatDiffCoeff $stdMatAlphaMultiplier | |
| − | + | fillmode $stdMatFillMode | |
| − | + | ||
| − | + | ||
| − | + | stage | |
| − | + | texture $stdMatEnvCubeTextureName -alphaFalloffCubeMap 64 (0, 1, 0) (-30, 255) 5 | |
| − | + | textureMIPFilterHint disabled | |
| + | ffTextureCoordsSource fromNormal | ||
| + | textureTransformType vector3 | ||
| + | textureAddressing clamp clamp clamp | ||
| + | textureBlend select(texture:alphaReplicate) multiply(texture colorScalar) | ||
| + | end | ||
| − | + | stage | |
| − | + | texture $stdMatBaseTextureName ${stdMatBaseTextureParam} | |
| − | + | ffTextureCoordsSource 0 | |
| + | textureBlend select(colorScalar) multiply(outRegister texture) | ||
| + | end | ||
| + | end | ||
| + | else | ||
| + | |||
| + | # VS/PS equivelant | ||
| + | pass | ||
| + | create NonStandardLighting() | ||
| + | |||
| + | alphaBlend srcFactor(srcAlpha) add dstFactor(one) | ||
| + | depthTest true -enableDepthWrite false | ||
| + | fillmode $stdMatFillMode | ||
| − | + | shaderProgram -target vertexProgram -method assemble | |
| − | + | bindConstants 0 -bindingID geomToClip -constantCount 4 | |
| − | + | bindConstants 4 -bindingID geomToCamera -constantCount 3 | |
| − | + | shaderSource | |
| − | + | vs_1_1 | |
| − | + | dcl_position v0 | |
| − | + | dcl_normal v1 | |
| − | + | dcl_texcoord v2 | |
| − | + | ||
| − | + | m4x4 oPos, v0, c0 ; send to clip space | |
| − | + | ||
| − | + | mov oT1.xy, v2 ; copy tex coords straight out | |
| − | + | ||
| − | + | m3x3 oT0.xyz, v1, c4 ; transform normal to camera space. | |
| − | + | ||
| − | + | endShaderSource | |
| − | + | end | |
| − | + | ||
| − | + | shaderProgram -target pixelProgram -method assemble | |
| − | + | ||
| − | + | setv3 evalDiffuse ($stdMatDiffCoeff) | |
| − | + | bindConstants 0 -bindingID immediateData -data ($evalDiffuse, $stdMatAlphaMultiplier) | |
| − | + | ||
| − | + | shaderSource | |
| − | + | ps_1_1 | |
| − | + | tex t0 ; a cube map | |
| − | + | tex t1 ; a 2D texture | |
| − | + | ||
| − | + | mov r0.rgb, c0 ; output color from the diffuse | |
| − | + | + mul r0.a, t0.a, c0.a ; alpha = tex0.a * tex1.a * alphaMultiplier | |
| − | + | mul r0.a, r0.a, t1.a | |
| − | + | ||
| − | + | endShaderSource | |
| − | + | ||
| − | + | end | |
| − | + | ||
| − | + | ||
| − | + | sampler 0 | |
| − | + | texture $stdMatEnvCubeTextureName -alphaFalloffCubeMap 64 (0, 1, 0) (-30, 255) 5 | |
| − | + | textureMIPFilterHint disabled | |
| − | + | textureAddressing clamp clamp clamp | |
| − | + | end | |
| − | + | sampler 1 | |
| − | + | texture $stdMatBaseTextureName ${stdMatBaseTextureParam} | |
| − | + | end | |
| − | + | ||
| − | + | end | |
| − | + | ||
| − | + | endif | |
| − | + | end # shader | |
| − | + | ||
| − | + | #fallback, do nothing | |
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | end | + | |
shader | shader | ||
end | end | ||
| + | |||
end | end | ||
enddef | enddef | ||
| − | materialDefinition | + | # |
| − | setDefinition | + | # Various lighting glows. |
| − | addParam stdMatLayer | + | # |
| − | addParam stdMatEnvCubeTextureName | + | materialDefinition lightingTableBigBulb_glowSphere |
| − | addParam stdMatBaseTextureName | + | setDefinition CubeAlphaFalloff |
| + | addParam stdMatLayer 15 | ||
| + | addParam stdMatDiffCoeff (1, 1, .8) | ||
| + | addParam stdMatAlphaBlendMode additive | ||
| + | addParam stdMatAlphaMultiplier 0.55 | ||
| + | addParam stdMatEnvCubeTextureName lightingStreetlight_glow_alphaFalloff5 | ||
| + | addParam stdMatBaseTextureName lightingStreetlight-glowSphere-alpha | ||
end | end | ||
| − | materialDefinition | + | materialDefinition lightingStreetlight_glowSphereNull |
| − | setDefinition | + | setDefinition Null |
| − | addParam stdMatLayer | + | addParam stdMatLayer 15 |
| + | addParam stdMatDiffCoeff (1, 1, 1) | ||
| + | addParam stdMatAlphaBlendMode additive | ||
| + | addParam stdMatAlphaMultiplier 1 | ||
addParam stdMatEnvCubeTextureName steamSphere_alphaFalloff5 | addParam stdMatEnvCubeTextureName steamSphere_alphaFalloff5 | ||
| − | addParam stdMatBaseTextureName | + | addParam stdMatBaseTextureName steam-alpha |
end | end | ||
| − | materialDefinition | + | materialDefinition lightingStreetlight_glowSphere |
| − | + | setDefinition CubeAlphaFalloff | |
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | setDefinition | + | |
addParam stdMatLayer 15 | addParam stdMatLayer 15 | ||
| − | addParam stdMatEnvCubeTextureName | + | addParam stdMatDiffCoeff (1, 1, .8) |
| − | addParam stdMatBaseTextureName | + | addParam stdMatAlphaBlendMode additive |
| + | addParam stdMatAlphaMultiplier 1 | ||
| + | addParam stdMatEnvCubeTextureName lightingStreetlight_glow_alphaFalloff5 | ||
| + | addParam stdMatBaseTextureName lightingStreetlight-glowSphere-alpha | ||
end | end | ||
| − | + | materialDefinition memoryIcon_glowSphere | |
| − | materialDefinition | + | setDefinition CubeAlphaFalloff |
| − | setDefinition | + | addParam stdMatLayer 15 |
| − | addParam stdMatLayer | + | addParam stdMatDiffCoeff (1, 1, .8) |
| − | addParam stdMatEnvCubeTextureName | + | addParam stdMatAlphaBlendMode additive |
| − | addParam stdMatBaseTextureName | + | addParam stdMatAlphaMultiplier 1 |
| + | |||
| + | addParam stdMatEnvCubeTextureName lightingStreetlight_glow_alphaFalloff5 | ||
| + | addParam stdMatBaseTextureName reflection3DGlow-envcube6 | ||
end | end | ||
Revision as of 11:58, 7 September 2007
EP6-BV 0xCD7FE87A 0x1C0532FA 0x8674B810 0xFF9F1489
- glow
- Used for glow/steam effects: transparency falls off at edges
- of object. (Camera-relative normal looks up into a cube map.)
define CubeAlphaFalloff()
material
attributes
attribute steamRGB float3
attribute steamAlpha float1
end
shader -layer ($stdMatLayer * 18 + 17)
vertexFormatPred position 0 true
vertexFormatPred normal 0 true
vertexFormatPred texcoord 0 true
vertexFormatPred blendindices 0 false
vertexFormatPred targetindices 0 false
create DetermineHardwareSupport()
if ($useFixedFunctionPath or $useSWVertexShaderPath) pass -fixedFunction create LightingStatesNoStdLightsParam(true false) alphaBlend srcFactor(srcAlpha) add dstFactor(one) depthTest true -enableDepthWrite false ffMatCoef -amb (1,1,1) -diff (1,1,1) -emit (0,0,0) -spec (0,0,0) -specPow 0 colorScalar $stdMatDiffCoeff $stdMatAlphaMultiplier fillmode $stdMatFillMode
stage texture $stdMatEnvCubeTextureName -alphaFalloffCubeMap 64 (0, 1, 0) (-30, 255) 5 textureMIPFilterHint disabled ffTextureCoordsSource fromNormal textureTransformType vector3 textureAddressing clamp clamp clamp textureBlend select(texture:alphaReplicate) multiply(texture colorScalar) end
stage texture $stdMatBaseTextureName ${stdMatBaseTextureParam} ffTextureCoordsSource 0 textureBlend select(colorScalar) multiply(outRegister texture) end end else
# VS/PS equivelant pass create NonStandardLighting()
alphaBlend srcFactor(srcAlpha) add dstFactor(one) depthTest true -enableDepthWrite false fillmode $stdMatFillMode
shaderProgram -target vertexProgram -method assemble bindConstants 0 -bindingID geomToClip -constantCount 4 bindConstants 4 -bindingID geomToCamera -constantCount 3 shaderSource vs_1_1 dcl_position v0 dcl_normal v1 dcl_texcoord v2
m4x4 oPos, v0, c0 ; send to clip space
mov oT1.xy, v2 ; copy tex coords straight out
m3x3 oT0.xyz, v1, c4 ; transform normal to camera space.
endShaderSource end
shaderProgram -target pixelProgram -method assemble
setv3 evalDiffuse ($stdMatDiffCoeff) bindConstants 0 -bindingID immediateData -data ($evalDiffuse, $stdMatAlphaMultiplier)
shaderSource ps_1_1 tex t0 ; a cube map tex t1 ; a 2D texture
mov r0.rgb, c0 ; output color from the diffuse + mul r0.a, t0.a, c0.a ; alpha = tex0.a * tex1.a * alphaMultiplier mul r0.a, r0.a, t1.a
endShaderSource
end
sampler 0
texture $stdMatEnvCubeTextureName -alphaFalloffCubeMap 64 (0, 1, 0) (-30, 255) 5
textureMIPFilterHint disabled
textureAddressing clamp clamp clamp
end
sampler 1
texture $stdMatBaseTextureName ${stdMatBaseTextureParam}
end
end
endif
end # shader
#fallback, do nothing
shader
end
end
enddef
- Various lighting glows.
materialDefinition lightingTableBigBulb_glowSphere
setDefinition CubeAlphaFalloff addParam stdMatLayer 15 addParam stdMatDiffCoeff (1, 1, .8) addParam stdMatAlphaBlendMode additive addParam stdMatAlphaMultiplier 0.55 addParam stdMatEnvCubeTextureName lightingStreetlight_glow_alphaFalloff5 addParam stdMatBaseTextureName lightingStreetlight-glowSphere-alpha
end
materialDefinition lightingStreetlight_glowSphereNull
setDefinition Null addParam stdMatLayer 15 addParam stdMatDiffCoeff (1, 1, 1) addParam stdMatAlphaBlendMode additive addParam stdMatAlphaMultiplier 1 addParam stdMatEnvCubeTextureName steamSphere_alphaFalloff5 addParam stdMatBaseTextureName steam-alpha
end
materialDefinition lightingStreetlight_glowSphere
setDefinition CubeAlphaFalloff addParam stdMatLayer 15 addParam stdMatDiffCoeff (1, 1, .8) addParam stdMatAlphaBlendMode additive addParam stdMatAlphaMultiplier 1 addParam stdMatEnvCubeTextureName lightingStreetlight_glow_alphaFalloff5 addParam stdMatBaseTextureName lightingStreetlight-glowSphere-alpha
end
materialDefinition memoryIcon_glowSphere
setDefinition CubeAlphaFalloff addParam stdMatLayer 15 addParam stdMatDiffCoeff (1, 1, .8) addParam stdMatAlphaBlendMode additive addParam stdMatAlphaMultiplier 1 addParam stdMatEnvCubeTextureName lightingStreetlight_glow_alphaFalloff5 addParam stdMatBaseTextureName reflection3DGlow-envcube6
end