G'day,
I've managed to get a cube map rendering outside of sunburn onto a sphere. Now I want that sphere to cast shadows as well as be cube mapped.But I am stumped, and I am using deferred lighting.Currently I have 3 stages for rendering my cube map:
Now, for me to do this in suburn, I believe I must:
Hi 2.0,
Cool, looks like you got most of it figured out.
2.0 Studios:How do I update an automatically loaded shader that is being applied to an object?
You can access the effect / material and set the cube map using the following code:
foreach(ModelMesh mesh in <the model assigned your shader>.Meshes){ foreach(Effect effect in mesh.Effects) { EffectParameter param = effect.Parameters["<name of your cube texture in the fx code>"]; if(param == null) continue; param.SetValue(<your cube texture object>); }}
Let me know if this helps!
Follow me on Twitter – development and personal tweetsAwesome XNA Videos – Lighting, Rendering, and game videos
Haha, I should have guessed that! My cube maps now work.Although the fresnel effect dissapeared on the reflection. If I have trouble with it, I'll post seperately.Thanks!