Blender question

Post your questions, suggestions and experiences regarding to Image manipulation, 3d modeling and level editing for the Irrlicht engine here.
Post Reply
Heresiarch
Posts: 14
Joined: Mon Mar 16, 2009 1:21 pm
Location: Finland

Blender question

Post by Heresiarch »

Hello,

I want to make a transparent window with blender and export it to irrlicht.
How can i do that? (I'm new to blender :lol: )
pc0de
Posts: 300
Joined: Wed Dec 05, 2007 4:41 pm

Post by pc0de »

I don't have specific instructions for a transparent window, but this tutorial on exporting a transparent material using irrb should give you a reasonably good idea on how to do it.
Heresiarch
Posts: 14
Joined: Mon Mar 16, 2009 1:21 pm
Location: Finland

Post by Heresiarch »

Thank you for quick answering pc0de :D

I'll try that right away
mc08
Posts: 25
Joined: Thu Aug 07, 2008 9:49 am

Post by mc08 »

hmm this does not explain how to make something like 50% transparent, for example diry or coloured glas... :/
Heresiarch
Posts: 14
Joined: Mon Mar 16, 2009 1:21 pm
Location: Finland

Post by Heresiarch »

does irrb work with blender 2.49?
I cant get it work with it :?
mc08 wrote:hmm this does not explain how to make something like 50% transparent, for example diry or coloured glas... :/
Yes, that would be great :twisted:
xray
Posts: 231
Joined: Fri Feb 02, 2007 1:06 pm
Location: Germany, Munich
Contact:

Post by xray »

For this you can use the A (=Alpha) slider which you can find in the material buttons under the color sliders.
pc0de
Posts: 300
Joined: Wed Dec 05, 2007 4:41 pm

Post by pc0de »

Yes, irrb works with Blender 2.49. And here's a little more information on creating transparent windows - like xray noted you'll need to make the glass area of the window semi-transparent using the alpha channel of the image. After you've done that, uv map the window image/texture to the portion of your mesh that contains the window. It's that simple :).

Here's a quick semi-transparent window I created in gimp:
window.xcf

The layer named "Glass Tint" contains the alpha setting. The blood & scratch layers were created using custom brushes (google "gimp blood & scratchy brushes").

In Blender I created a floor & wall and cut out 3 windows using "loop cut" (CTRL+R in edit mode). Textured the windows and assigned the UV layer name: "trans_alphach". Here's a link to the .blend file (with packed images):
window.blend

And some screen shots from iwalktest:
Image

Image

Image
Heresiarch
Posts: 14
Joined: Mon Mar 16, 2009 1:21 pm
Location: Finland

Post by Heresiarch »

Thank you so much pc0de and xray :D
mc08
Posts: 25
Joined: Thu Aug 07, 2008 9:49 am

Post by mc08 »

thanks a lot for that description, pc0de! exactly what i was wondering about. I tried it out and created a very very simple room with transparent windows. in the door i have 3 different levels of transparence. 30% 50% 70%. The 30% one doesn't show up and all the edges are jagged and very sharp. Hard to explain, please take a look at this screenshot instead:

http://pici.se/pictures/JiHzMKJMy.jpg

Please help, what do i do wrong? The texture is 1024*1024 png. saved it with standard gimp2.6 settings.
Edit: also seems like the black color get some kind of opacity O.o
pc0de
Posts: 300
Joined: Wed Dec 05, 2007 4:41 pm

Post by pc0de »

hey mc08, well I just exported the window.blend sample and then opened it in IrrEdit and everything looks good so it doesn't have anything to do with IrrEdit itself:

Image

Is your Blender UV layer name set to "trans_alphach" and not "trans_alphach_ref"? If it is set to "trans_alphach" please post a link to your .blend file with the textures packed into the .blend file itself. Thanks.
xray
Posts: 231
Joined: Fri Feb 02, 2007 1:06 pm
Location: Germany, Munich
Contact:

Post by xray »

Which type of png did you saved your image ? Is it a 32 bit png ? Because there are also 8bit and 24bit png's, maybe you used one of this.
mc08
Posts: 25
Joined: Thu Aug 07, 2008 9:49 am

Post by mc08 »

I do not know what type of png the texture is, but it looks good except when I apply it as texture. I exported the model with gandaldfs b3d exporter and loaded in irrEdit 1.4. In irrEdit i needed to apply the texture in the models texture tab, and set it to trans_alphack myself. It does not look better with trans_alphack_ref or any other setting.

here is the .blend-file, the uv-texture and exported modell:
http://hem.bredband.net/magosen/index.html

How did you export your scene? You didn't use b3d, right? Should that make any difference, since it is the texture that is looking bad?

thx in advance :)
pc0de
Posts: 300
Joined: Wed Dec 05, 2007 4:41 pm

Post by pc0de »

mc08 wrote:How did you export your scene?
I used irrb which creates .irrmesh files. But how you're doing it should work as well. I'll test your method later and let you know how it turns out.
pc0de
Posts: 300
Joined: Wed Dec 05, 2007 4:41 pm

Post by pc0de »

Exporting with irrb and opening in irrEdit displays the three levels of transparency correctly:

Image

So it looks to me like the .b3d exporter is setting the material type to trans_alphach_ref. Setting the Blender UV layer name to trans_alphach is only relevant to the irrb exporter.
mc08
Posts: 25
Joined: Thu Aug 07, 2008 9:49 am

Post by mc08 »

SOLVED the problem. I tried irrb and exported the "house" and everything worked. IN IRREDIT 1.5
Then after some testing i figured out that it is IrrEdit 1.4.1 that screws everything up. the texture looks great even in my old .b3d in irrEdit 1.5!

Thx a lot, though. Now I've got another exporter for bigger scenes that seems to work great. :)
Post Reply