• Advertisement
Sign in to follow this  

Lighting algrothim for Rendering Gems

This topic is 3732 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Check out this paper:

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

It seems to do exactly what you describe.

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
Thanks guys. I think I can use a combination of both articles. Ill let u know my results as soon as I'm done.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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 :(

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement