Transparency rendering in Irrlicht

Transparency rendering in Irrlicht

Postby rudy85 » 27 Sep 2010, 01:10

This is difference between irrlicht and plib :
Transparency-irrlicht-vs-plib.png


Up :Plib
Down : Irrlicht
The same material :
Capture-Fenêtre sans nom-4.png


So I've tried another value in alpha canal :
Capture-Fenêtre sans nom-3.png


But the result stay the same :|
Capture-Fenêtre sans nom-2.png
Last edited by rudy85 on 09 Oct 2010, 11:25, edited 2 times in total.
STK 3D animation
My work is under the licence you want
User avatar
rudy85
 
Posts: 420
Joined: 06 Dec 2009, 13:44
Location: France

Re: Transparency rendering in Irrlicht

Postby Auria » 27 Sep 2010, 02:02

Hi,

I believe the B3D exporter ignores materials completely. The currently supported way of having transparent surfaces is to texture them with a PNG that includes an alpha channel
Image
User avatar
Auria
STK Moderator
 
Posts: 2976
Joined: 07 Dec 2009, 03:52

Re: Transparency rendering in Irrlicht

Postby rudy85 » 27 Sep 2010, 17:30

ok , I will try :think:
STK 3D animation
My work is under the licence you want
User avatar
rudy85
 
Posts: 420
Joined: 06 Dec 2009, 13:44
Location: France

Re: Transparency rendering in Irrlicht

Postby rudy85 » 27 Sep 2010, 22:05

Yes and we have to edit material.xml

{l Code}: {l Select All Code}
<?xml version="1.0"?>
<materials>
  <material name="Wire.png" alpha="Y" light="N" collide="Y"/>
</materials>
STK 3D animation
My work is under the licence you want
User avatar
rudy85
 
Posts: 420
Joined: 06 Dec 2009, 13:44
Location: France

Re: Transparency rendering in Irrlicht

Postby rudy85 » 09 Oct 2010, 11:39

:!: What are you thinking to do to improve transparency : It seem that an item into a transparent box or sphere doesn't appear :?
It' s a real limit for conception to making glass door, fish in lake or in aquarium , wine in a drink
:!:

3 of my track could not be ported to irrlicht :shock:
STK 3D animation
My work is under the licence you want
User avatar
rudy85
 
Posts: 420
Joined: 06 Dec 2009, 13:44
Location: France

Re: Transparency rendering in Irrlicht

Postby Auria » 09 Oct 2010, 18:43

This seems to be a bug in irrlicht, unfortunately we cannot fix it, the irrlicht developers will need to
Image
User avatar
Auria
STK Moderator
 
Posts: 2976
Joined: 07 Dec 2009, 03:52

Re: Transparency rendering in Irrlicht

Postby rudy85 » 09 Oct 2010, 19:18

STK 3D animation
My work is under the licence you want
User avatar
rudy85
 
Posts: 420
Joined: 06 Dec 2009, 13:44
Location: France

Re: Transparency rendering in Irrlicht

Postby rudy85 » 09 Oct 2010, 23:31

Thanks Auria for supporting me :)
STK 3D animation
My work is under the licence you want
User avatar
rudy85
 
Posts: 420
Joined: 06 Dec 2009, 13:44
Location: France

Re: Transparency rendering in Irrlicht

Postby acme_pjz » 10 Oct 2010, 08:07

This seems to be a bug in irrlicht, unfortunately we cannot fix it, the irrlicht developers will need to


I don't think so. When rendering something with transparency, you need MANUALLY determine render order (render far items first, then near items) because after rendering near items with transparency the Z-buffer is updated, then if you want to render far items behind the near items it will fail to pass Z-test ... So maybe you guys forgot to change render order (or forgot to set a flags that tells Irrlicht to re-order items) ...
Some of my open source games on GitHub
User avatar
acme_pjz
 
Posts: 663
Joined: 10 Dec 2009, 15:32
Location: PeeKing, China

Re: Transparency rendering in Irrlicht

Postby rudy85 » 10 Oct 2010, 09:41

Could you be more explicit please ?
STK 3D animation
My work is under the licence you want
User avatar
rudy85
 
Posts: 420
Joined: 06 Dec 2009, 13:44
Location: France

Re: Transparency rendering in Irrlicht

Postby acme_pjz » 10 Oct 2010, 10:25

Could you be more explicit please ?


Well, it's too technical ... but it's not artist's fault ;)

===========================

[EDIT] These are explanations:
What is Z-buffer
http://en.wikipedia.org/wiki/Z-buffering
The Z buffer doesn't work for transparent polygons.
http://www.sjbaker.org/steve/omniv/alpha_sorting.html
Some of my open source games on GitHub
User avatar
acme_pjz
 
Posts: 663
Joined: 10 Dec 2009, 15:32
Location: PeeKing, China

Re: Transparency rendering in Irrlicht

Postby Auria » 10 Oct 2010, 15:44

acme_pjz {l Wrote}:I don't think so. When rendering something with transparency, you need MANUALLY determine render order (render far items first, then near items) because after rendering near items with transparency the Z-buffer is updated, then if you want to render far items behind the near items it will fail to pass Z-test ... So maybe you guys forgot to change render order (or forgot to set a flags that tells Irrlicht to re-order items) ...


No, 3D engines normally do that automatically for you; we wouldn't use a 3D engine if we needed to manually tell it everything to do ^^
Image
User avatar
Auria
STK Moderator
 
Posts: 2976
Joined: 07 Dec 2009, 03:52

Re: Transparency rendering in Irrlicht

Postby hiker » 11 Oct 2010, 01:00

Hi,

irrlicht sorts the scene nodes by transparency/non-transparency. So try to export the transparent meshes as a separate object (set the properties: type="object', name="some filename" interaction="static" in blender before running the track exporter), and see if this fixes the transparency.

Cheers,
Joerg
hiker
 
Posts: 1435
Joined: 07 Dec 2009, 12:15
Location: Melbourne, Australia

Re: Transparency rendering in Irrlicht

Postby hiker » 14 Oct 2010, 03:19

Hi,

I had a good look again, and I think I understand the issue now, and it might actually not be an irrlicht problem:

hiker {l Wrote}:irrlicht sorts the scene nodes by transparency/non-transparency. So try to export the transparent meshes as a separate object (set the properties: type="object', name="some filename" interaction="static" in blender before running the track exporter), and see if this fixes the transparency.

That was actually not correct :oops: Irrlicht registers scene node to be rendered in the transparent and/or non-transparent pass. If a scene node (e.g. a kart) has both, it will be registered in both passes, and only render the appropriate meshes in each of the phases. So irrlicht should be able to handle a model like this correctly.




So I had a closer look at the adiumy model: the problem is that the window mesh is not actually set to be transparent in STK, and therefore it is rendered in the wrong pass. When I quickly hacked STK to set all meshes of adiumy to be transparent, you could indeed see through the glass to the driver :) So that's good news ;)

Unfortunately stk only supports setting the material properties (like transparency) for textured meshes, so there is no easy way atm to fix this in stk. But the following should work: can you assign a simple transparent texture to the windscreen? Then you can set the appropriate value in the materials.xml file for that texture, making the window transparent, and then triggering the correct rendering order. Then adiumy should work as expected.

There might be some support in the b3d file format for that, but I don't think the exporter can handle this atm.

Could you test the approach with the transparent texture and let me know how you go?

Cheers,
Joerg
hiker
 
Posts: 1435
Joined: 07 Dec 2009, 12:15
Location: Melbourne, Australia

Re: Transparency rendering in Irrlicht

Postby rudy85 » 24 Oct 2010, 23:55

It's ok for me ! :)
STK 3D animation
My work is under the licence you want
User avatar
rudy85
 
Posts: 420
Joined: 06 Dec 2009, 13:44
Location: France

Who is online

Users browsing this forum: No registered users and 1 guest