Jump to content

  • Log In with Google      Sign In   
  • Create Account

Rendering refraction and transparent objects


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 mk1x86   Members   -  Reputation: 442

Like
0Likes
Like

Posted 16 November 2012 - 11:09 AM

Hello there, I'd like to implement refractive objects (water, glass etc) and two problems arise:

1) In order to use refraction I need to render everything else to a texture. Is that correct or is there another way?

2) Since glass is transparent I need to order it back to front. If 1) applies I'd have to render the multiple times. In case of three transparent objects where the second one is refractive:

a) render solid geometry to texture
b) render 1st transparent object to texture
c) render refractive object using the texture from a) and b)
d) render 2nd transparent object

Now this seems like a performance killer and I suspect there're better ways to do this. I don't know how though and my search didn't come up with anything informative. Maybe you have a solution to my problem?

Sponsor:

#2 Lauris Kaplinski   Members   -  Reputation: 841

Like
1Likes
Like

Posted 17 November 2012 - 08:15 AM

I do not know any other way.
Even worse - to have proper refraction it is not enough to simply render all your scene to texture, because you have to render it using "refracted" camera viewpoint. There may be areas that are not directly visible to camera but become visible via refraction.

Normally such problems are solved via level design - avoid placing too many semitransparent objects in such way that they need expensive processing.
Lauris Kaplinski

First technology demo of my game Shinya is out: http://lauris.kaplinski.com/shinya
Khayyam 3D - a freeware poser and scene builder application: http://khayyam.kaplinski.com/

#3 Radikalizm   Crossbones+   -  Reputation: 2885

Like
0Likes
Like

Posted 17 November 2012 - 08:23 AM

Even worse - to have proper refraction it is not enough to simply render all your scene to texture, because you have to render it using "refracted" camera viewpoint.


You can often cheat with this though, the illusion of refraction can still be quite believable even if it's not completely correct. Getting physically correct refractions will open up a nice large box of headache inducing issues, so maybe cutting some corners here and there is the way to go.

I gets all your texture budgets!


#4 mk1x86   Members   -  Reputation: 442

Like
0Likes
Like

Posted 17 November 2012 - 10:05 AM

Indeed I don't need proper refraction, just the illusion. But ordering transparent and refractive objects is certainly an issue. I expect to have refractive objects on top of everything else most of the time but specifically for water planes this is an issue :-(

#5 Lauris Kaplinski   Members   -  Reputation: 841

Like
0Likes
Like

Posted 17 November 2012 - 10:39 AM

Indeed I don't need proper refraction, just the illusion. But ordering transparent and refractive objects is certainly an issue. I expect to have refractive objects on top of everything else most of the time but specifically for water planes this is an issue :-(


At least you can usually avoid transparent objects behind water plane. And you never need two water planes behind each other ;-)
Lauris Kaplinski

First technology demo of my game Shinya is out: http://lauris.kaplinski.com/shinya
Khayyam 3D - a freeware poser and scene builder application: http://khayyam.kaplinski.com/

#6 mk1x86   Members   -  Reputation: 442

Like
0Likes
Like

Posted 17 November 2012 - 12:33 PM

Then replace water plane by window pane. Unfortunately it's still the same problem. There must be a solution :-(




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS