X files and color

Blitz3D Forums/Blitz3D Programming/X files and color

D4NM4N(Posted 2005) [#1]
Does anyone know why vertex color will not load from an X file in blitz or in gile? (yes the flag is 2). Is it a non supported feature of X files or is it new in for DX9/8


Shambler(Posted 2005) [#2]
DX7 X-File format does support vertex colours, but the question is does Blitz load them?

Do you have a mesh with vertex colours that you can try and load into Blitz...If not I will have a look for one.

[Edit] I hear that UU lets you paint vertex colours on a mesh, if you can do that and export to .X then you could try loading that mesh.


Shambler(Posted 2005) [#3]
Ok, this is the last version of my DX exporter I can find and it does handle both textureUV and vertexcolors on the mesh I tried it with...not sure about vertex alpha though.




D4NM4N(Posted 2005) [#4]
Thanks for that,
Here is my mesh export i wrote. Ill compare the two later and see if ive missed anything out.



I can now get the vertex colors to work in blitz if i flag 2 ok, but isnt there a way to set flags in x(like you can in b3d), to tell blitz how to treat the mesh without having to resort to lots of recursive entityfx setting?

One thing that confuses me is writing of the mesh vertexcolors, you are doing them as actual RGBA values. I am using 0-1 range for colors ie rval#=red/255. Which seems to work ok in blitz, but which is correct?, i checked giles x xport and it does this color division as well.

The other thing im having problems with is texture scale, anyone know how can i introduce a scaled texture into the file.


Shambler(Posted 2005) [#5]

I can now get the vertex colors to work in blitz if i flag 2 ok, but isnt there a way to set flags in x(like you can in b3d), to tell blitz how to treat the mesh without having to resort to lots of recursive entityfx setting?



EntityFX has no meaning in X-File format and I can't see a way of coding it into the file so that Blitz automatically enables vertex colour.


One thing that confuses me is writing of the mesh vertexcolors, you are doing them as actual RGBA values. I am using 0-1 range for colors ie rval#=red/255. Which seems to work ok in blitz, but which is correct?, i checked giles x xport and it does this color division as well.



Having checked the doc's it does look like 0.0f-1.0f is the correct range to use.


The other thing im having problems with is texture scale, anyone know how can i introduce a scaled texture into the file.



I think you would have to use the texture scale to modify the texture coordinates when you save them.