how to make a glass window? (transparent part of a model)

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
michael520
Posts: 230
Joined: Mon Oct 10, 2005 2:24 am

how to make a glass window? (transparent part of a model)

Post by michael520 »

I make a truck using 3ds max. it has two window using the opacity to 40%.

then I load the exported x format file in Irrlicht, but the window is not transparent.

how to let part of a model be transparent? such as a car's window?

Help~~~~~
CZestmyr
Posts: 72
Joined: Sat Feb 12, 2005 7:11 pm
Location: Czech Republic
Contact:

Post by CZestmyr »

You'd better create your windows as separate models and then add them to the truck scene node as children. To make them transparent, you just have to change the material properties of the nodes. e.g. : You could use following code, privided that your window glass texture has got an alpha channel:

Code: Select all

node->setMaterialType(EMT_TRANSPARENT_ALPHA_CHANNEL);
Bugfree is not a synonym to dumbass-resistant

My irrlicht files and tutorials
My music in mp3
michael520
Posts: 230
Joined: Mon Oct 10, 2005 2:24 am

Post by michael520 »

CZestmyr wrote:You'd better create your windows as separate models and then add them to the truck scene node as children. To make them transparent, you just have to change the material properties of the nodes. e.g. : You could use following code, privided that your window glass texture has got an alpha channel:

Code: Select all

node->setMaterialType(EMT_TRANSPARENT_ALPHA_CHANNEL);
Thanks! this could be useful, but does this mean irrlicht really not support that?

and I encounter another problem,too.
In 3dsmax, the car's material is set, and the two light are set to self-emit material.
But when loading it in irrlicht, the car body's material seems none, but the car lights' self-emit material looks good.
I don't know why. Irrlicht doesn't support this use of material?
CZestmyr
Posts: 72
Joined: Sat Feb 12, 2005 7:11 pm
Location: Czech Republic
Contact:

Post by CZestmyr »

In fact, Irrlicht doesn't support materials as such, it just uses the textures and texture mapping coordinates (as far as I know).
Bugfree is not a synonym to dumbass-resistant

My irrlicht files and tutorials
My music in mp3
MikeR
Posts: 767
Joined: Sun Dec 26, 2004 4:03 pm
Location: Northern California USA
Contact:

Post by MikeR »

When Niko updates the dmf loader, it supports transperancy. (dmf is the format for the DeleD Scene Builder. http://www.delgine.com
If it exists in the real world, it can be created in 3d

Sys specs:
AMD 3700+ 64 processor
1.0 gb ram
e-Geforce 6600 graphics 256 mb onboard ram
michael520
Posts: 230
Joined: Mon Oct 10, 2005 2:24 am

Post by michael520 »

MikeR wrote:When Niko updates the dmf loader, it supports transperancy. (dmf is the format for the DeleD Scene Builder. http://www.delgine.com
Thanks! But when will Niko update it?
I think it should be a normal thing for an engine to have this function

And I only need to view a model, a scene builder is not suitable cause I am going to build my own scene format.
pfo
Posts: 370
Joined: Mon Aug 29, 2005 10:54 pm
Location: http://web.utk.edu/~pfox1

Post by pfo »

Milkshape 3D (which gets bashed quite a lot here) supports transparency, it would work very well for glass. If you're familiar with the program, in materials, under emissive color there's a slider, move it to the left and watch your material turn transparent. What's even cooler is when you load it up in Irrlicht, it looks nearly exactly the same.
needforhint
Posts: 322
Joined: Tue Aug 30, 2005 10:34 am
Location: slovakia

Post by needforhint »

if the windows are mapped by a different material (you can do multisub material in any modeler and load it) then just use
getMaterial("the number of glass material") .MaterialType=video::EMT_TRANSPARENT_ALPHA_CHANNEL; but see the namespace reference, I don't think I get it right :roll:
what is this thing...
pr3t3nd3r_guest

Post by pr3t3nd3r_guest »

My3DTools 3 (.my3D)
I think is suporting models with some transparent zones. (particles system too (not sure)) ...
Twinsen
Posts: 27
Joined: Thu Nov 03, 2005 2:05 pm
Location: Gold Coast

Post by Twinsen »

http://irrlicht.sourceforge.net/phpBB2/ ... php?t=9763

check out my post here.
basically in max, i'm not sure if ur 3d app supports it but u can group polygons in max to a id and then in ur code u can assign a texture to the id of selected polygons
"Sorry, Twinsen, you don't have enough Kashes. "- Yeah right pal
Post Reply