fun with .pso

More
18 years 2 months ago #14550 by Second Chance
Replied by Second Chance on topic fun with .pso
Good idea. I was trying to avoid any specific solutions in that toturial in order to focus on what the problem was and how to identify it. Darkfire was supposed to write about an easy solution in Lightwave, but he never got around to it. I would certainly welcome any additional information or tutorials you'd care to add to the thread. Just please specify what 3D packages they work with. Or what the features might be called in other packages.

I guess I really should go back in there and add the words concave poly somewhere. [:I]

Anyone hear anything new on Jasper's work?

mailto:second_chance@cox.net
The Ultimate Guide To Modding: I-War 2 - Edge Of Chaos
.

Please Log in or Create an account to join the conversation.

More
18 years 2 months ago #14552 by Jasper
Replied by Jasper on topic fun with .pso
Hi all,

Been away for a while and only just got to a computer that can read word docs.

The first 16 bytes of the 20 unknown bytes in the SHDR chunk in your doc are 4 floating point values that give surface colour and transparency, R, G, B and Alpha.

for the Alpha 1.0 is opaque and 0.0 is fully transperent.

surface colour is only rendered by the game engine if there are no textures on the surface, it's mainly used on transparent surfaces to tint windows etc.

the next 4 is the floating point diffuse value which effects surface lighting.

The "vertex format mode" is better thought of as a count of the number of u,v texture co-ords per vertex in the VERT chunk (you need to know this to find out how big each vert entry is).

In the VERT chunk it's self, easy entry is always:

first 6 floats:

<X, Y, Z> <surface normal vector>

and then depending on the number of textures per vertex a <U,V> pair for each texture.

There are no W co-ords, and no vertex colours.

As for which UV pair is used for which texture the order is: colour, specular, and luminosity.

It's possible for a surface to have just a specular map, or just a glowmap, these ones do:

./avatars/modularstations/0_EngLarge.PSO
./avatars/modularstations/1_Eng_small.PSO
./avatars/modularstations/1_Comms(JB)_T.PSO
./avatars/modularstations/0_Eng_small.PSO
./avatars/modularstations/0_Comms(JB)_T.PSO

You can tell which textures are being used by the index values in the SHDR chunk - an index of 0 means no texture is used, so a surface with a colour texture index of 4 and a specular texture index of 2 and a luminosity texture index of 0 would have 2 UV pairs for each vertex, and the first pair would be the colour, and the 2nd would be the specular.

(and the colour texture bitmap to use would be the 4th in the list in the OHDR chunk, and the spec bitmap to use would be the 2nd in the list in the OHDR chunk, but that well understood now).


---
If there is hope it lies with the demo scene.
PSO and FTEX tools: pointless.net/eoc/

---
If there is hope it lies with the demo scene.
PSO and FTEX tools: pointless.net/eoc/

Please Log in or Create an account to join the conversation.

More
18 years 2 months ago #14553 by davel
Replied by davel on topic fun with .pso
Ahhh, that does clear some things up. I was assuming a W coord for the texture coordinates. Looks like I have to make some changes. I'll do that and update my documentation. That should complete the .pso format documentation I think. Thanks.

Do you happen to know the standard way of compressing with DXT1, I couldn't find any documentation for it. IE, how do you determine your color0 and color1. Are they generated or selected from the 4x4 texel.

Jasper, your Kung-Fu is the best!

Please Log in or Create an account to join the conversation.

More
18 years 2 months ago #14554 by Jasper
Replied by Jasper on topic fun with .pso
There is no standerd way to compress DXT1 :(!

Since DXT1 is lossy, and works really badly with some textures writing a good general purpose compressor is fairly tricky.

I use the ATI compression library but i don't know if you can call c functions in a DLL in max script&#058;

www.ati.com/developer/compress.html

There are also tools from Nvidia that can do directX compression from the command line, but most modern DXTC tools are built around the DDS file format, which, like .ftc, stores compressed mipmaps as well as the texture.

Unfortunatly Flux dosn't understand .dds - it was written just after DXTC was invented, but before .dds was.

There is some open source code out there that implements a compressor, but it's pretty slow, i think it's in the DevIL library.




---
If there is hope it lies with the demo scene.
PSO and FTEX tools: pointless.net/eoc/

---
If there is hope it lies with the demo scene.
PSO and FTEX tools: pointless.net/eoc/

Please Log in or Create an account to join the conversation.

More
18 years 2 months ago #14556 by davel
Replied by davel on topic fun with .pso
Ugh, PSOs are crazy, some byte orders are little endian, others are big endian. Lucky me, maxscript does not read big endian. I've had to write a half dozen functions to convert byte orders....Yay! Now I'm able to convert all the UV data and I'm pulling in the surface colors, amounts, etc.

I'm going to update my documenation later on, but for now I have to go back to work for The Man!

Please Log in or Create an account to join the conversation.

More
18 years 2 months ago #14557 by Second Chance
Replied by Second Chance on topic fun with .pso
Awsome! Keep on truckin' davel. I can't wait for the next release.

mailto:second_chance@cox.net
The Ultimate Guide To Modding: I-War 2 - Edge Of Chaos
.

Please Log in or Create an account to join the conversation.