Outerra forum

Anteworld - Outerra Game => Modding: Importer, Tools & Utilities => Topic started by: KW71 on November 08, 2014, 08:20:48 pm

Title: PLEASE Somebody help "alpha_masked"
Post by: KW71 on November 08, 2014, 08:20:48 pm
Hi!

Need help, please. I need to make some holes in a material. I have read the manual (Material definition, Textures notes and Material parameters), and I can't figure it out.


So far I have been able to use opacity texture, with


-   "text_opacity" : "x" where x = DDS texture, no alpha channel, (works fine whether compressed in DTX5 or ATI1).
-   "color" : "1.0,1.0,1.0,0.99",


Since "0.99" makes all the material a bit transparent, I can't use it to make just holes.


I have tried

-   "color" : "1.0,1.0,1.0,1.0",
-   "alpha_masked" : true,
-   "tex_albedo" : "x" where x = DDS texture, with alpha channel, compressed in DTX5 (I saw your trees textures have this format).



But nothing happens. Whether alpha channel pixel is black or white, there is no transparency.

________________________________

Also found this

"The alpha masked geometry isn't supported yet, but you can use standard transparency for now.

Code: [Select]

{
   "name" : "transparent",
   "diffuse" : "255,255,255,0",
   "Ax" : "0.04",
   "Ay" : "0.04",
   "m" : "0.2",
   "tex_diffuse" : "diffuse.dds",
   "tex_normal" : "",
   "tex_env" : "",
   "tex_opacity" : "opacity.dds" //< has to be ATI1 format in DDS it's alpha only"




But using 0 in diffuse (guess is "color"), make my model almost invisible.


I would appreciate any help.
Title: Re: Help "alpha_masked"
Post by: theshanergy on November 08, 2014, 11:06:03 pm
probably not the answer you're looking for, but why not just put holes in the model itself?
Title: Re: Help "alpha_masked"
Post by: KW71 on November 08, 2014, 11:13:24 pm
probably not the answer you're looking for, but why not just put holes in the model itself?

Too many holes!!! Six triangles would become hundreds, if not over a thousand. I would rather use this polygons detailing something else.
Title: Re: PLEASE Somebody help "alpha_masked"
Post by: zzz on November 10, 2014, 07:26:20 am
You'll need to split the texture into 1 that is the opaque parts and 1 that is the transparent parts. The transparent texture will get its own entry in the mtl file.

Alternatively if the transparent parts line up over polygons you can use a 3d editor to highlight the polygons that will be transparent and separate them, then apply the same texture this new second group. It'll also have its own mtl entry.
Title: Re: PLEASE Somebody help "alpha_masked"
Post by: PytonPago on November 10, 2014, 07:38:17 am
You'll need to split the texture into 1 that is the opaque parts and 1 that is the transparent parts. The transparent texture will get its own entry in the mtl file.

Alternatively if the transparent parts line up over polygons you can use a 3d editor to highlight the polygons that will be transparent and separate them, then apply the same texture this new second group. It'll also have its own mtl entry.

 Thats kinda a bad thing for textures like a rost-riddled barrel - also, dirty windows would be a pain this way ...
Title: Re: PLEASE Somebody help "alpha_masked"
Post by: KW71 on November 10, 2014, 10:00:50 am
You'll need to split the texture into 1 that is the opaque parts and 1 that is the transparent parts. The transparent texture will get its own entry in the mtl file.

Alternatively if the transparent parts line up over polygons you can use a 3d editor to highlight the polygons that will be transparent and separate them, then apply the same texture this new second group. It'll also have its own mtl entry.

Thanks for the answer!

What if all the polygons have visible and  invisible pixels?... Let's say, for example, I have a tree made of two planes  intersected at 90°.

If I  use a texture with alpha channel (This, I guess, would be the equivalent to "opacity mask" in UDK):

-   "color" : "1.0,1.0,1.0,1.0",
-  "alpha_masked" : true,

Nothing happen. There is no transparency.

If take the alpha channel in a separate texture, and use it like this:

-   "color" : "1.0,1.0,1.0,1.0",
-   "text_opacity" : "tree_transparency.dds",

Also nothing happen. There is no transparency.

If I change this value

-   "color" : "1.0,1.0,1.0,0.99",
-   "text_opacity" : "tree_transparency.dds",

The black pixels of the opacity texture becomes invisible, but also the white pixels are a little  transparents. I can see trough trunk and branches. [/size]

Thanks for your time and support!
Title: Re: PLEASE Somebody help "alpha_masked"
Post by: zzz on November 10, 2014, 10:06:01 am
As far as I'm aware, the only functioning transparency setting atm is the setting you highlighted in red, which will apply a uniform transparency to the object that mtl entry applies to.
Title: Re: PLEASE Somebody help "alpha_masked"
Post by: KW71 on November 10, 2014, 10:17:18 am
I'll try to do what you said before, splitting sections.

Thank you very much, ZZZ!
Title: Re: PLEASE Somebody help "alpha_masked"
Post by: M7 on November 10, 2014, 02:54:22 pm
Just use  "color" : "1.0,1.0,1.0,0.999",

and you shouldn't percieve any transparency in the white area of your opacity texture.
Title: Re: PLEASE Somebody help "alpha_masked"
Post by: KW71 on November 10, 2014, 10:14:01 pm
Just use  "color" : "1.0,1.0,1.0,0.999",

and you shouldn't percieve any transparency in the white area of your opacity texture.

I have tried that, but the problem is still there. Here are my tests.

http://forum.outerra.com/index.php?topic=3035.msg32232#msg32232

In the end I need alpha masked, because transparency cast no shadows. I guess is possible, because trees are using this method.
Title: Re: PLEASE Somebody help "alpha_masked"
Post by: M7 on November 10, 2014, 11:23:38 pm
which 3d software did you use to make it and which importer, collada or fbx? Ive seen similar weird rendering with sketchup model imported through collada importer.
Title: Re: PLEASE Somebody help "alpha_masked"
Post by: KW71 on November 11, 2014, 12:23:36 am
FBX. But the behavior seams right as long as I keep separate meshes when transparency is used, and don't use the same transparency material for two objects, one inside another.

As far as I can see:
- Transparency is fine.
- Alpha masked is not working.
Title: Re: PLEASE Somebody help "alpha_masked"
Post by: angrypig on November 12, 2014, 11:25:17 am
Hi guys I just checked there a few bugs in material rendering. Fixing now...
Title: Re: PLEASE Somebody help "alpha_masked"
Post by: M7 on November 12, 2014, 11:41:43 am
Just made a quick test of my own on a single mesh with a 100% white opacity texture.
 "color" : "1.0,1.0,1.0,.999",  and  "color" : "1.0,1.0,1.0,1.0",

So looks like the engine cant tell what part is in front of which, on a single mesh when transparent.
and yes there's no shadow on transparent object even at .999
Title: Re: PLEASE Somebody help "alpha_masked"
Post by: angrypig on November 12, 2014, 11:54:31 am
Transparency is WIP there more unfinished things in materials. We will improve it soon.
Title: Re: PLEASE Somebody help "alpha_masked"
Post by: PytonPago on November 12, 2014, 11:57:00 am
Just made a quick test of my own on a single mesh with a 100% white opacity texture.
 "color" : "1.0,1.0,1.0,.999",  and  "color" : "1.0,1.0,1.0,1.0",

So looks like the engine cant tell what part is in front of which, on a single mesh when transparent.
and yes there's no shadow on transparent object even at .999

 You UVd those parts ?
Title: Re: PLEASE Somebody help "alpha_masked"
Post by: M7 on November 12, 2014, 02:47:06 pm
yes i did it quite  a while ago just for testing and i used the automatic UV option in blender.
Title: Re: PLEASE Somebody help "alpha_masked"
Post by: PytonPago on November 12, 2014, 02:49:00 pm
... automatic UV option in blender.

Oh my, that must have been a terrible sight ...
Title: Re: PLEASE Somebody help "alpha_masked"
Post by: KW71 on November 12, 2014, 03:44:51 pm
Hi guys I just checked there a few bugs in material rendering. Fixing now...

Great, thanks!


I saw your response to this post:

http://forum.outerra.com/index.php?topic=2033.msg21792#msg21792

one year ago. Is alpha masking not implemented yet?