Few questions

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
johann_gambolputty
Posts: 28
Joined: Mon Nov 02, 2009 9:51 am

Few questions

Post by johann_gambolputty »

Ok so what is the best way to export complete levels from 3ds max ? (scene hierarchy , only meshes , i do not need cameras and lights)Since my levels are extremely complex (bunch of transparent decals , alpha , and additive) i really dont want to export all the meshes one by one , this would take ages... .So i've tried literally EVERY possible way and all failed. My last idea was the COLLADA .dae format but this also has some issues with texture loading...

Code: Select all

<library_images>
    <image id="c_concrete02.bmp" name="c_concrete02_bmp">
      <init_from>file:///E:/Textures/castle/c_concrete02.bmp</init_from>
    </image>
  </library_images>
Irrlicht tries to load the textures described in <ini_from> which is the full path of my 3ds max textures folder ,instead of MY_GAME_PATH + <image id>
which is : mygame/c_concrete02.bmp"

the debug message is :

Code: Select all

Could not open file of texture : e:/mygame/textures/file:///E:/Textures/castle/c_concrete02.bmp
As you can see irrlicht combines the two paths for some reason...

My second question is why there's no material like EMT_LIGHTMAP_TRANSPARENT_ALPHA_CHANNEL ? All my transparent decals looks really bad with no lightmaps.It doesn't fit into my levels

Thanks
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Few questions

Post by CuteAlien »

Can't help much with 3d max export. But the Collada error is interesting, I'll put that on my todo. It probably doesn't know about the file:/// part and so no longer recognizes it's an absolute path. Although - using absolute paths like that will fail anyway once you distribute your application to other people.
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: Few questions

Post by The_Glitch »

I use the DirectX file format .X and use 3ds max and it works really well. I haven't tried any other format so If you can try it, it can handle meshes with animations or no animations static for levels or worlds. If you export from 3ds max and load the file in Irrlicht it will load all the diffuse textures automatically which is nice. You have to set any other texture uses manually ieg "bump maps or detail textures".
The_Glitch
Competition winner
Posts: 523
Joined: Tue Jan 15, 2013 6:36 pm

Re: Few questions

Post by The_Glitch »

Also search the web for a DirectX plugin for 3ds max.
johann_gambolputty
Posts: 28
Joined: Mon Nov 02, 2009 9:51 am

Re: Few questions

Post by johann_gambolputty »

Thanks for everyone for the reply. I'm using the x exporter for max , but i just recently realised that the loaded mesh's materials can be changed for each meshBuffer separately i didnt know that until today... we learn something new each day :D

But can someone help me with my 2nd issue ? mixing the lightmap and alpha transparency ?
I found this :

http://irrlicht.sourceforge.net/forum/v ... hp?t=27902

i tried it , but it seems it's broken and not working with 1.8 . I get the desired the transparent effect but the main texture layer is missing. Everything is overridden with yellow color
i can show you a screenshot if needed.

Thanks in advance
Foaly
Posts: 142
Joined: Tue Apr 15, 2014 8:45 am
Location: Germany

Re: Few questions

Post by Foaly »

Hello!
This type of material really sounds usefull!
I will write one for OpenGL and D3D (or fix the one you showed). If it works, I really hope it will be included into Irrlicht!

PS. Why does nobody answer my thread about the solid 2 layer material, which I've fixed (in bug reports)?
The_Glitch
Competition winner
Posts: 523
Joined: Tue Jan 15, 2013 6:36 pm

Re: Few questions

Post by The_Glitch »

I'm not sure what your trying to do exactly but If you have lets say a certain material in your structure that needs transparency you can access that material specifucally and set it to use transparent type. For example

Code: Select all

node->getMaterial(4).setMaterialType = EMT_TRANSPARENT_ALPHA_CHANNEL;
so with this line material 4 will be transparent and all others will be what ever material type you used before. Obviously yours will be different.
johann_gambolputty
Posts: 28
Joined: Mon Nov 02, 2009 9:51 am

Re: Few questions

Post by johann_gambolputty »

The_Glitch wrote:I'm not sure what your trying to do exactly but If you have lets say a certain material in your structure that needs transparency you can access that material specifucally and set it to use transparent type. For example

Code: Select all

node->getMaterial(4).setMaterialType = EMT_TRANSPARENT_ALPHA_CHANNEL;
so with this line material 4 will be transparent and all others will be what ever material type you used before. Obviously yours will be different.

Yeah i know that but , on the top of that transparent layer i want an additional lightmap texture , so all in all i want the same meshbuffer draw with two textures :


node->getMaterial(4).TextureLayer[0] = transparentTexture;
node->getMaterial(4).TextureLayer[1] = lightmapTexture;
node->getMaterial(4).setMaterialType = EMT_USE_TRANSPARENCY_FROM_LAYER0_AND_LIGHTMAP_FROM_LAYER1;

This type a of a material is really usefull in certain situations .For an example : graffiti decals on a lightmapped wall. So because a picture is worth a thausand words here is a screenshot of what i'm trying to do :

Image

As you see can the decal on the wall is transparent , but also uses a lightmap to "fit" in the dark area of the scene
The_Glitch
Competition winner
Posts: 523
Joined: Tue Jan 15, 2013 6:36 pm

Re: Few questions

Post by The_Glitch »

Ah okay yeah you would need to make a shader in this case. Irricht gives you a good starting point but in this case yeah a shader. I've been working on Directional Lightmaps for Irrlicht. I've got it complete I just need to finish setting up the Irrlicht side of things. Picture doesn't account for gamma yet. It's based off Valves source paper.


Image
Rather simple mesh though.
Foaly
Posts: 142
Joined: Tue Apr 15, 2014 8:45 am
Location: Germany

Re: Few questions

Post by Foaly »

I've finished the material renderers for D3D and OpenGL! But the code is too big (it's 4 material renderes, which are added inside the drivers and the EMaterialTypes.h also had to be changed) to upload it here.
It supports all light map types + transparent with alpha channel / transparent alpha channel ref

I think that this material types is really important and should be part of the Irrlicht engine.
And the material described there (http://irrlicht.sourceforge.net/forum// ... =2&t=27609) should also be part of Irrlicht (it is really useful for fading LOD levels, and a lot faster than setting the vertex color alpha).

I hope the Irrlicht developers agree in integrating these material types, and I would also write the code for it, so they don't have to spend too much time on it.
Post Reply