This content has been marked as final. Show 2 replies
I think there's two problems here:
You're getting slightly confused between setting texture list properties, and setting the first item of those lists. This may not actually be the cause of your problem, but does look like you're using the commands a little differently to how they are documented, so it might help:
textureList, blendConstantList, blendFunctionList, and textureModeList are all lists, so you should be assigning values to a particular index (position) within that list. The lists each have 8 items, which represent the 8 texture layers that a shader can make use of.
In your case, it looks like you want the reflection texture to appear over the base diffuse colour of the shader, rather than a base diffuse texture, so your reflection texture can go in channel 1 of the texture list, like this:
redShader.textureList = sky
Then you can set the other properties for that specific texture channel like this:
redShader.blendConstantList = 50
redShader.blendFunctionList = #add
redShader.textureModeList = #reflection
If you wanted to have your reflection appear on top of a diffuse texture, your diffuse texture would go in channel 1, and your reflection texture would go in channel 2.
The other problem is, there's another property which you need to set because you want your diffuse colour to show through when using texture. By default, if you use any textures, the diffuse colour of the shader is ignored. This property makes it include the diffuse colour with the textures which I think is what you're after:
redShader.useDiffuseWithTexture = true
hope this helps!
Ben, I thank you but what do you know, I worked it out for myself. Was just about to post the answer but you beat me to it.
My nemesis thus nolonger- Mymember.shader[MyShaderNo].useDiffuseWithTexture = 1
Tell you one thing, your wrong, "Im not slightly confused" am hitting a brickwall here. Im a little rusty with lingo and had all but abandoned it...
Seriously, thanks for your thorough explaination, my head feels a little less fuzzy thanks to your endeavours.....Ta.