Lighting algrothim for Rendering Gems

Started by
6 comments, last by Enrico 16 years, 4 months ago
Hi I'm currently having trouble conceiving a lighting algorithm/shader that is capable of rendering Gems like the one in the image below. If anyone with experience can give me some direction as to what I can do it would be much appreciated.
Advertisement
I would assume that the tricky bit is not so much the lighting but the refractions. Here's what I think you should do:

- Render a cube map from the center of the gem (obviously without actually rendering the gem itself)
- Render the backfaces of the gem by sampling from the cube map both for reflection and refraction.
- Render the front faces of the gem using the same procedure but for refraction, sample from the frame buffer and not the cube map (so you'll get that double-refraction of front faces refracting back faces which refract the background)
- In a post-process, add some bloom around the highlights. Make it nice and subtle though.

I think this should give you pretty good results. Note that rendering cube maps in real-time is pretty expensive since you'll have to render the scene six times. It's probably better to do that only once at start-up or even render the cube-map offline entirely.
Thank you so much Ill give it a try.
Check out this paper:

http://artis.imag.fr/Publications/2004/GS04/

It seems to do exactly what you describe.
"Math is hard" -Barbie
ATI has a paper about rendering Crystals/Candies. Somewhere on their page or the shaderX-books they have another article how they have rendered the gigantic gem in one of their Radeon Launch Demos. I just can not find it...
--
Thanks guys. I think I can use a combination of both articles. Ill let u know my results as soon as I'm done.
Quote:Original post by Enrico
ATI has a paper about rendering Crystals/Candies. Somewhere on their page or the shaderX-books they have another article how they have rendered the gigantic gem in one of their Radeon Launch Demos. I just can not find it...


Game Programming Gems 5 has an article about gem rendering and I believe it is by ATi. Maybe this is the one you mean?
Oliver Charles (aka aCiD2) [ Cycles Blog ]
Quote:Original post by Cycles
Game Programming Gems 5 has an article about gem rendering and I believe it is by ATi. Maybe this is the one you mean?

Ah, yes. Thanks :)
I must have confused the books. I dont have them at hand, they are all in boxes in the cellar :(
--

This topic is closed to new replies.

Advertisement