Outerra forum

Anteworld - Outerra Game => Modding: Importer, Tools & Utilities => Topic started by: bleach on April 28, 2021, 08:56:32 pm

Title: Do transparent objects have to use a separate material?
Post by: bleach on April 28, 2021, 08:56:32 pm
hi all,

I am trying to set up a vehicle that uses a single material with an opacity map. The entire exterior of the vehicle uses a single UV mapped material. Although the glass is a separate mesh, the material is the same as the rest of the exterior. For transparency we were hoping to use an opacity texture, however, this doesn't seem to have an effect regardless of the colour alpha channel, format of the opacity map (-bc4 -linear, etc etc). We also tried different shader values and 'alpha_coverage' values and combinations. Alpha masking seems to work fine, it is just alpha blending that is giving us troubles.

If it is possible we want a single material for a vehicle exterior that uses an opacity map. is this possible or do all "glass" type objects require a separate material?

material example

{
    "version" : 512,
    "mats" : [
        {
      "name" : "my-material",
      "shader" : "",
      "alpha_coverage" : true,
      "color" : "1.0,1.0,1.0,1.0",
      "f0" : "0.039",
      "roughness" : "1.0",
      "emissive_color" : "1.0,1.0,1.0",
      "sun_lag" : 0.0,
      "max_temperature_black" : 40,
      "max_temperature_white" : 20,
      "thermal" : "",
      "tex_albedo" : "my-albedo.dds",
      "tex_normal" : "my-normal.dds",
      "tex_roughness" : "my-roughness.dds",
      "tex_opacity" : "my-opacity.dds",
      "tex_reflectance" : "my-reflectance.dds",
      "tex_environment" : "",
      "tex_emissive" : "myt-emissive.dds",
      "tex_thermal" : ""
   }
    ]
}
Title: Re: Do transparent objects have to use a separate material?
Post by: KW71 on April 29, 2021, 05:50:27 pm
Hi! Yes, you need two materials for that, because:

1.- If you set color to:
   "color" : "1.0,1.0,1.0,0.99",
the whole vehicle will be transparent, although "my-opacity.dds" will determine how much transparente each surface will be.

2.- If you use
  "shader" : "alpha_masked",
your opacity texture will deterimine which parts are "invisible" and which not. But you won't have any reflections on the invisible sections.
Title: Re: Do transparent objects have to use a separate material?
Post by: bleach on April 29, 2021, 07:27:47 pm
Thank you for the reply, We will start to break the transparent objects out of the material. Is there any way that we can get data on the render time to assist debugging and performance scaling?

Thanks!