Basic HLSL Lighting Techniques - Episode 5
Uploader Comments (NemoKradXNA)
All Comments (11)
-
Or you can build the cubemap on the fly, but that will take 4 renders,
You might want to look at Dual-Paraboloid Reflections, GraphicsRunner has a good post on that.
-
Well, like any reflection/refraction, it's a common problem.
You could render the scene without your refraction object first, then pass that as the refraction texture, then render the scene again, but put the camera at the same position of the reflective model but have it rotated back out to the viewer and use that image for the reflection.
-
Hey NemoKradXNA, thanks to your help I was able to implement the glass shader :D. However, since I only do sample from the sky box, other objects are not visible through the glass. Do you know how to fix this issue? Thanks.
-
Yes, I would recoment Blender 3D as it is free :)
Yes, you can change the texture passed to the shader, as long as it follows the UV map it should look good.
-
Oh I see. So I should use like Maya or 3dsMax to texture the teapot, then export the .x file right ? I just wonder let say I want to change the texture on the fly, is it possible to swap the original textures with the new one in my application ?
-
That is all done in the model. If it has been UV mapped. IF your model is not UV'd then you wont get good results. In my sample, when I create the flag, I have to set the UV manually this is done by setting the TexCoords in the vertex array
Hey NemoKradXNA,
I just finish implementing true reflection / refraction using dynamic cube mapping. Visit my Youtube channel or my blog if you have time :D.
cgAddict 2 years ago
Nice one, I'll take a look :)
NemoKradXNA 2 years ago
Hey NemoKradXNA,
I tried out the method u mentioned but no luck. Probably because I don't know how to setup my texture / render target right. Have you implemented that way before?
About the dual-paraboloid, I'll look into it but probably it will take a while since he wrote it in C#.
cgAddict 2 years ago
OK, if I get time I will have a crack at implementing a true reflection/refraction.
Keep an eye on the channel or my blog and I will post it once I crack it (time willing)
NemoKradXNA 2 years ago