blanders refraction doen't work

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
ritti
Posts: 90
Joined: Tue Apr 10, 2012 12:09 pm

blanders refraction doen't work

Post by ritti »

Hi,
to be more specific, I'm trying to make a glass model with refraction.
If I look through this model, all that whats behind it should be distorted (as I look through a glass of water), but thats not the case.
What I did:
a sphere in blender with transparent material, and changed the IOR value to 1.1 in the Raytrace tab.
exported as b3d and obj, then I loaded it in my game.
But if I put a Scenenode behind this sphere it looks normal instead of distorted.

Am I missing something?
Or can I set this IOR value directly in Irrlicht?

Any help would be much appreciated.
Best regards
Ritti
CuteAlien
Admin
Posts: 9929
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: blanders refraction doen't work

Post by CuteAlien »

I don't think you can do that with standard materials. Pretty certain you will need a shader for that.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
ritti
Posts: 90
Joined: Tue Apr 10, 2012 12:09 pm

Re: blanders refraction doen't work

Post by ritti »

Thank you for your answer,
I found this nice tutorial http://irrlicht.sourceforge.net/forum/v ... hp?t=27054
but there I have to do 2 draw calls and well thats no option in a strategy game :)

Maybe do you know a good alternative?

Thanks and best regards

Ritti
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Re: blanders refraction doen't work

Post by sudi »

ritti wrote:Thank you for your answer,
I found this nice tutorial http://irrlicht.sourceforge.net/forum/v ... hp?t=27054
but there I have to do 2 draw calls and well thats no option in a strategy game :)

Maybe do you know a good alternative?

Thanks and best regards

Ritti
Why are 2 draw calls not an option?

Besides transparent objects are drawn after the solid ones. So you can render the solid scene to a rendertarget. copy that target. then render the transparent objects into the first one and use the scene copy to make the disortion. but i think thats how the example there works anyways
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
ritti
Posts: 90
Joined: Tue Apr 10, 2012 12:09 pm

Re: blanders refraction doen't work

Post by ritti »

Yes you are right, thats how the example works.
The problem is that the game slows down terribly with two draw calls.
Maybe it would be no problem with hardware skinning, but as long as this doesn't work with opengl in Linux I can't use it.
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Re: blanders refraction doen't work

Post by christianclavet »

Hi,
a sphere in blender with transparent material, and changed the IOR value to 1.1 in the Raytrace tab.
CuteAlien was right. RAYTRACING is not supported on any realtime rendering engine that I know of.

This effect must be faked with a shader. Your example is good for that and I think you need 2 passes because it's using RTT to do it's stuff.
The problem is that the game slows down terribly with two draw calls.
These effects are "expansive" to render. Why faking raytracing effects in a strategy game? Is it really needed?
Maybe it would be no problem with hardware skinning
This is only related to the skinning of the bones and it's surrounding meshes. Nothing related to the rendering of a model material.
Post Reply