Depth and transparency [SOLVED]
Depth and transparency [SOLVED]
Hi,
Pardon me as I know a solution for this issue might be somewhere on board.
I just can't find the right solution.
I'm using irrlicht and irredit 1.4.2.
As in image, the trees behind the fence are rendered in front of the fence.
I use trans_alphach as material type for both trees and fence.
How can I fix this problem?
Thanks in advance.
Pardon me as I know a solution for this issue might be somewhere on board.
I just can't find the right solution.
I'm using irrlicht and irredit 1.4.2.
As in image, the trees behind the fence are rendered in front of the fence.
I use trans_alphach as material type for both trees and fence.
How can I fix this problem?
Thanks in advance.
Last edited by aungsithu on Fri Nov 21, 2008 6:50 am, edited 1 time in total.
Aung Sithu
*** Check out my latest book, Beginner's guide to Irrlicht 3D engine: http://bit.ly/rSnm4O
Company: http://rivaledge.sg
*** Check out my latest book, Beginner's guide to Irrlicht 3D engine: http://bit.ly/rSnm4O
Company: http://rivaledge.sg
Thanks.
ZWriteEnable is set to True and ZBuffer is already set to 1 for all the trees and fences. It still doesn't solve the problem and I still see this 'incorrect' rendering in irrEdit.
What did I miss something?
ZWriteEnable is set to True and ZBuffer is already set to 1 for all the trees and fences. It still doesn't solve the problem and I still see this 'incorrect' rendering in irrEdit.
What did I miss something?
Aung Sithu
*** Check out my latest book, Beginner's guide to Irrlicht 3D engine: http://bit.ly/rSnm4O
Company: http://rivaledge.sg
*** Check out my latest book, Beginner's guide to Irrlicht 3D engine: http://bit.ly/rSnm4O
Company: http://rivaledge.sg
-
- Posts: 208
- Joined: Sun Apr 02, 2006 9:20 pm
Thanks all for inputs.
Right now, I'm just using irredit to construct and visualize the scene.
Setting to trans_alpharef make some trees to be correctly rendered.
But some trees are still being rendered in front of the fence.
I'll check the other ways posted here when I render the scene from code.
Thank you all.
Right now, I'm just using irredit to construct and visualize the scene.
Setting to trans_alpharef make some trees to be correctly rendered.
But some trees are still being rendered in front of the fence.
I'll check the other ways posted here when I render the scene from code.
Thank you all.
Aung Sithu
*** Check out my latest book, Beginner's guide to Irrlicht 3D engine: http://bit.ly/rSnm4O
Company: http://rivaledge.sg
*** Check out my latest book, Beginner's guide to Irrlicht 3D engine: http://bit.ly/rSnm4O
Company: http://rivaledge.sg
-
- Posts: 1691
- Joined: Sun May 18, 2008 9:42 pm
DX9?
Are you using a DirectX driver?. It does'nt seem to happen in OpenGL.
That would be illogical captain...
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
Yes. Because in irrEdit, there's only D3D9, D3D8 and software driver.
I'll try with OGL again in irrlicht.
I'll try with OGL again in irrlicht.
Aung Sithu
*** Check out my latest book, Beginner's guide to Irrlicht 3D engine: http://bit.ly/rSnm4O
Company: http://rivaledge.sg
*** Check out my latest book, Beginner's guide to Irrlicht 3D engine: http://bit.ly/rSnm4O
Company: http://rivaledge.sg
-
- Posts: 208
- Joined: Sun Apr 02, 2006 9:20 pm
I've been playing about with this a bit today while integrating trees into my wrapper project. Hybrid's advice is the complete solution and I implemented a command in the wrapper to use: -
smgr->getParameters()->setAttribute(scene::ALLOW_ZWRITE_ON_TRANSPARENT, true);
EMT_TRANSPARENT_ALPHA_CHANNEL_REF does seam to correct the problem but probably only by chance in the implementation, it is however the better option to use as it is intended to be the faster implementation for foliage. It does have the draw back of not being effected by vertex lighting as far as I can see though.
After using ALLOW_ZWRITE_ON_TRANSPARENT as Hybrid suggests, IRR_EMT_TRANSPARENT_ALPHA_CHANNEL also seams to work properly and is effected by vertex lighting too.
When using ALLOW_ZWRITE_ON_TRANSPARENT and EMT_TRANSPARENT_ALPHA_CHANNEL_REF with textures that have alpha channels that contain aliased pixels, these pixels seam to pick up the background color giving them an oddly colored edge. Changing the textures so the alpha value was just 0 or 255 would clear up the problem I think.
Regards,
smgr->getParameters()->setAttribute(scene::ALLOW_ZWRITE_ON_TRANSPARENT, true);
EMT_TRANSPARENT_ALPHA_CHANNEL_REF does seam to correct the problem but probably only by chance in the implementation, it is however the better option to use as it is intended to be the faster implementation for foliage. It does have the draw back of not being effected by vertex lighting as far as I can see though.
After using ALLOW_ZWRITE_ON_TRANSPARENT as Hybrid suggests, IRR_EMT_TRANSPARENT_ALPHA_CHANNEL also seams to work properly and is effected by vertex lighting too.
When using ALLOW_ZWRITE_ON_TRANSPARENT and EMT_TRANSPARENT_ALPHA_CHANNEL_REF with textures that have alpha channels that contain aliased pixels, these pixels seam to pick up the background color giving them an oddly colored edge. Changing the textures so the alpha value was just 0 or 255 would clear up the problem I think.
Regards,
[quote="Frank EMT_TRANSPARENT_ALPHA_CHANNEL_REF does seam to correct the problem but probably only by chance in the implementation, it is however the better option to use as it is intended to be the faster implementation for foliage. It does have the draw back of not being effected by vertex lighting as far as I can see though.
[/quote]
yes i know this is by chance, and hybrid advice is correct one. but im too afraid to change source in irrlicht and compile :p
[/quote]
yes i know this is by chance, and hybrid advice is correct one. but im too afraid to change source in irrlicht and compile :p
-
- Posts: 208
- Joined: Sun Apr 02, 2006 9:20 pm