(Solved)Transparency Issue(Solved once more)

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
The_Glitch
Competition winner
Posts: 523
Joined: Tue Jan 15, 2013 6:36 pm

(Solved)Transparency Issue(Solved once more)

Post by The_Glitch »

Well I have a building which is inside that has a material which is for glass that use's alpha transparency, which works fine on it's own but I run into a problem because I have a sky model that surrounds the environment which use's some transparency materials. The glass begins to disappear when the camera rotates or moves around inside the building. I tested and confirmed that it's because my glass and sky use transparent alpha channel and cause's problems for each other.

I read somewhere maybe to use 2 scene managers but I'm not sure that will help or not.
Last edited by The_Glitch on Wed Dec 24, 2014 8:24 pm, edited 1 time in total.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Transparency Issue

Post by CuteAlien »

Please add a screenshot of the problems, there's a small chance that there is another cause.
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
The_Glitch
Competition winner
Posts: 523
Joined: Tue Jan 15, 2013 6:36 pm

Re: Transparency Issue

Post by The_Glitch »

Old picture but it actually captured the problem to the right, the window disappears, the blue sky in the distance use transparency. If I don't draw the sky just the glass the problem is gone. My guess is because it has to do with two transparent objects one in front of the other.

http://s17.postimg.org/kshar6jjj/29_201 ... _01_89.png
^^ link for full picture If Irrlicht clips the picture in the post.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Transparency Issue

Post by CuteAlien »

Did you try drawing the sky without transparency? Do you do that do have the background image show through the sky?
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
The_Glitch
Competition winner
Posts: 523
Joined: Tue Jan 15, 2013 6:36 pm

Re: Transparency Issue

Post by The_Glitch »

Image
Here the window is drawn but only the parts that don't directly have the sky behind it.

Image
Here's the sky everything use's alpha channel except the blue skydome with stars/
The_Glitch
Competition winner
Posts: 523
Joined: Tue Jan 15, 2013 6:36 pm

Re: Transparency Issue

Post by The_Glitch »

I stumped the community once more I see LOL
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Transparency Issue

Post by CuteAlien »

I fear so. Problem as usual is that to investigate this I'd need time... (current panic-level in my work-project is around "I'm so gonna die").
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
thanhle
Posts: 325
Joined: Wed Jun 12, 2013 8:09 am

Re: Transparency Issue

Post by thanhle »

Sometimes you need to be patience.
It does takes time to get something right.

The expert people are probably too busy with their life.

Try find previous project or codes, I guess people would have solved that issue before.
Happy learning.
Cheers
Thanh
Klunk
Posts: 264
Joined: Mon Jan 10, 2011 5:21 pm

Re: Transparency Issue

Post by Klunk »

is your transparent star field object registered as a ESNRP_SKY_BOX ? I use this type for my custom sky dome with transparency. Just means it will always be rendered first negating any sorting issues.
The_Glitch
Competition winner
Posts: 523
Joined: Tue Jan 15, 2013 6:36 pm

Re: Transparency Issue

Post by The_Glitch »

No it's not that's a good idea how would I go about that?


Also I solved the issue by moving the sky model up in the world some as I fill the glass and sky were at even positions in the world causing that problem above and I made sure the outer most layer the star field is a sold material.

But Klunk I'd still like to try your approach sounds like a good idea for the future.


Image
Klunk
Posts: 264
Joined: Mon Jan 10, 2011 5:21 pm

Re: (Solved)Transparency Issue(Solved once more)

Post by Klunk »

the only issue with setting it as background object (ESNRP_SKY_BOX) is you have to manually set the draw order but as they are always supposed to be in the background this should not cause any draw problems.... I have a custom background mesh object that registers it's self as ESNRP_SKY_BOX to handle these thing.

Code: Select all

 
virtual void OnRegisterSceneNode()
    {
        if(IsVisible)
            SceneManager->registerNodeForRendering(this, ESNRP_SKY_BOX);
 
        ISceneNode::OnRegisterSceneNode();
    }
Post Reply