Model Alpha Transparency & Skins

Posted By: Carlos3DGS

Model Alpha Transparency & Skins - 05/22/12 18:06

I am creating a model with several parts I want to be transparent but I can't seem to get it looking right.
Any advice would be great.

This is what the skin looks like in photoshop:


This is what the alpha channel of the skin looks like in photoshop:


I save the texture with alpha channel, as 32 bit .TGA file (with no compression) and import into med.

This is what my model looks like in MED after applying the skin:


This is how the UV mapping looks like in the skin editor:


Just in case it is not clear, this is the structure of the UV mapping on the skin:


I load the cubes in sed like this:
Code:
FLOOR=ent_create("GrassCube.mdl",vector(x*32,y*32,z*32),NULL);
set(FLOOR,OVERLAY);



And this is what the final result looks like when I execute my code:


Why is the grass white instead of green?
I just can't seem to get this to work properly, so I have a few questions for anyone that can help me out or point me in the right direction:

Why is the grass color and transparency wrong in med and the skin editor (white squares)?
Why is the transparency correct when I execute my code but not in med (white grass)?
Why is color still wrong when I run my code? (It is getting the correct part of the skin because transparency is working correctly, but not the color)

Does anyone know what I am doing wrong?
Could it be my code, texture, file type, med modeling, or skin editor UV mapping?

Any advice would be great
Posted By: jane

Re: Model Alpha Transparency & Skins - 05/22/12 18:57

delete: set(FLOOR,OVERLAY);

.tga is automatically transparent
Posted By: Carlos3DGS

Re: Model Alpha Transparency & Skins - 05/22/12 19:19

Originaly I had it withought the overlay flag, the grass appeared white also. I was also getting a wierd white box outline of the grass square withought the overlay flag.

This is what it looks like withought setting the OVERLAY flag:

(It is kinda hard to see, but look at the grass that is close but at the far right, and also the grass at the back, they all have a white outline square around the texture)

Also withought the overlay flag the grass can be seen through the cube when it is not supposed to:

(In the picture above the camera is below the dirt/grass cubes, but you can see the grass through them withought the overlay flag)

Anyone else know how to fix the white grass problem?
Posted By: 3run

Re: Model Alpha Transparency & Skins - 05/22/12 19:23

Something already wrong in the Skin Editor, if I understand correctly from the Alpha channel in photoshop, color of the grass in Skin Editor should be green!
Posted By: Carlos3DGS

Re: Model Alpha Transparency & Skins - 05/22/12 22:30

Yup, the problem was med+skin editor... I had created the fake sprites manually in med using the face builder. Seems the skin editor dosn't like manually built faces from med.

I created a cube and merged vertexs to get a double sided flat square and this time it worked when UV mapping.
Thanks!



What I don't understand is why now some top parts of the grass are black (it changes depending on camera angle)... I don't use any shaders on this yet so I'm not sure if it's my fault due to something else?...
Posted By: sivan

Re: Model Alpha Transparency & Skins - 05/23/12 08:17

black things could be because of mipmaps, but if you use dds or checked mipmaps at skin settings then I don't know...
© 2024 lite-C Forums