About DirectX models.
About DirectX models.
If a Direct X model has more than 1 channel for UVW map applied, are the second vertex UV map loaded into the engine too?
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
-
- Posts: 43
- Joined: Mon Dec 01, 2008 6:35 pm
I tested it yesterday. I exported the level i use to work with, to add it light maps baked into another UVW map, and the .X file was bigger in size than the one which only had 1 set of UV coords, also, the code which loads directX models seems to be capable of loading more than one texture coordinate at first sight, but i wasn't sure if it was really used.
count on it Also, it seems LWO models may have unlimited texture UV maps, though graphics card may support up to 16, if i'm not mistaken.hybrid wrote:We have improved some things for the 1.5 release, but I doubt that multiple UV coords are already supported. If you can provide a mesh to wotk with it could go into Irrlicht 1.6, though
Do you know if it also works with HLSL shaders? If so, it would be quite interesting to work with B3D too. Thanks!zeroZshadow wrote:multiple UV channels are supported for b3d, tested it with lightmaps
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
I guess it depends on the exporter too. How are you planning to export your .X model, and are you sure the exporter will also write out the data correctly?
.X is a handy, but really awkward format to work with sometimes, so might be a good idea to use B3D too.
I heard .MD5 is also quite a handy format, shame Irrlicht doesn't support it yet
:\
.X is a handy, but really awkward format to work with sometimes, so might be a good idea to use B3D too.
I heard .MD5 is also quite a handy format, shame Irrlicht doesn't support it yet
:\
B3D seems to be still buggy (1.5, svn1933). I exported the mesh to that format, and suddenly, all the textures turned into 16 bit mode. Although forcing them to be 32 bit still worked right, the shaders also, stopped working well, even those which weren't used in the B3D model. just if all the system went crazy when using the B3D models. My normal map shaders also stopped working right, so, i'm sticking to .X. I'll deal a more detailed bug report about this later.
I have just noticed that too. seems that FVFData 258 is only used in the panda exporter, but also, seems that it is exported like that in other exporters like the KW X port
I have just noticed that too. seems that FVFData 258 is only used in the panda exporter, but also, seems that it is exported like that in other exporters like the KW X port
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Oh, my bad then... here is a small sample.
http://rapidshare.com/files/172763368/sample.rar
This is how it should look with the two coordinates applied.
http://rapidshare.com/files/172763368/sample.rar
This is how it should look with the two coordinates applied.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Ok, I have this working to some extent. However, two things still to define. First, the textures are not stored in the file. I've added them manually and added two texturefilename templates in the same material. Don't know if this is allowed, never saw it like that, but I can use it to add multiple textures per material. Second is, how to interpret the material. Should two textures be lightmap (with which multiplicator?) or detailmap, or maybe even solid_2_layer?! There's no such flag in the .x format that I'm aware of...
The code will be added to trunk/ (i.e. Irrlicht 1.6) because it changes quite a lot in the .x mesh handling, and this is too late to go into 1.5.
The code will be added to trunk/ (i.e. Irrlicht 1.6) because it changes quite a lot in the .x mesh handling, and this is too late to go into 1.5.
Sorry, my bad. I exported the shape with a shader that the panda exporter couldn't understand, and thus, it omited the texture, here is a fixed version, which defines the texture of the first set of coordinates. there is no way to propose the second texture inside the file.
http://rapidshare.com/files/173035526/fixed-sample.rar
The answer to your other question seems to be that DirectX format originally was meant to have only 1 set of mapping coordinates, but they left the FVFData to add more functionality that wasn't present at first, for developpers. So, people started using the FVFData to store the second set of mapping coordinates. As a consequence of this, there is no meaning for the second set other than the one the programmer wants to give it. In other words, is data for whatever programmers want to do with it, unlike perhaps the Q3 BSP's lightmaps, or B3D multitextures. You can do shadowmapping, detailmapping, or other effects. It seems to be a flexibility added to the format to allow it to be adapted to whatever creators want to do with it.
http://rapidshare.com/files/173035526/fixed-sample.rar
The answer to your other question seems to be that DirectX format originally was meant to have only 1 set of mapping coordinates, but they left the FVFData to add more functionality that wasn't present at first, for developpers. So, people started using the FVFData to store the second set of mapping coordinates. As a consequence of this, there is no meaning for the second set other than the one the programmer wants to give it. In other words, is data for whatever programmers want to do with it, unlike perhaps the Q3 BSP's lightmaps, or B3D multitextures. You can do shadowmapping, detailmapping, or other effects. It seems to be a flexibility added to the format to allow it to be adapted to whatever creators want to do with it.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Yep, the problem with this is that you might want only one part of the mesh using lightmaps or detailmaps, but the loader cannot distinguish. Moreover, we'd need to invent means to add proper material types for the lightmapped meshbuffers, while e.g. transparent ones still need to be transparent.
I'll add support for FVF and DeclData for lightmaps and normalmaps, and think about a way to specify materials via scene parameters.
I'll add support for FVF and DeclData for lightmaps and normalmaps, and think about a way to specify materials via scene parameters.
I thought of a sort of material definition via XML, unlike the one that is already in the engine, one which created basic OGL/DX shader on its own, abstracted to the user, much more focused to an artistic way, much like 3d application materials, using a basic shader as a starting point (a phong, shader, or a flat shaded, or a translucent ) a basic color, a specular power/level and a basic opacity.and think about a way to specify materials via scene parameters.
Then, adding a series of texture maps (lightmaps, bumpmaps) would modify the basic shader, and texture maps operations (such as fresnel, scrolling and so) to add effects. Though i guess this is not what you were looking for.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Correct, I was just thinking about a way to hint .x loader to proper interpretation of the second textureMel wrote:Then, adding a series of texture maps (lightmaps, bumpmaps) would modify the basic shader, and texture maps operations (such as fresnel, scrolling and so) to add effects. Though i guess this is not what you were looking for.and think about a way to specify materials via scene parameters.