Jump to content

[SOLVED] Alpha values


photo

Recommended Posts

Hi im working on something with a glass surface and I was wondering if it is possible to have a softer alpha,

at the moment I only achieved to have an alpha value of 1 and 0 so I can either see through it or not at all but I like to create some dirt on the windows so I need more than just 2 values

 

How do I do this in Unigine, and what are the settings for the material as I've been looking through the samples and demos but couldnt really find anything

 

Anyone know how to do this or have a tutorial perhaps?

Link to comment

Hi Rob,

Try setting your alpha to mid grey, then output to dxt5. When in unigine set blending modes to src alpha, and one minus src alpha. (no alpha test). This will give you control of the alpha slider in the colour setting on the parameters panel and give you more control.

 

Hope this helps.

Link to comment

Hi Rob,

Try setting your alpha to mid grey, then output to dxt5. When in unigine set blending modes to src alpha, and one minus src alpha. (no alpha test). This will give you control of the alpha slider in the colour setting on the parameters panel and give you more control.

 

Hope this helps.

 

Great will give this a shot! Thank you!

Link to comment

Here is a more detailed explanation / tutorial

(with pictures - for artists - too much code gets pasted around here :))

 

This will create a nice simple reflective dirty transparent glass with no refraction or shadow casting ability.

 

 

1. create textures for diffuse and specular both with interpolated alpha channels. (eg dxt3 or dxt5)

     -  for speed, follow the attached image (explanation_glass_dirty.jpg)

     -  diffuse is inverted and desaturated for specular texture

     -  copy your specular texture into the alpha channel of the diffuse texture

     -  copy your specular texture into the alpha channel of the specular texture (the alpha channel of the spec map interpolates / controls reflection amounts)

     -  save .dds with interpolated alpha

 

2. Inherit material from a reflective one.

     - set blending modes:    

                   Src: src alpha    

                   Dest: one minus src alpha

     - do not use alpha test

     - set textures, save and apply.

     - tweak values. (high glossiness value +180)

     - check 2-sided if you need

 

explanation_glass_dirty.jpg explains more about which parts of the textures and channels create different results.

post-73-0-06728600-1361551611_thumb.jpg

post-73-0-53024900-1361552254_thumb.jpg

Link to comment
  • 1 month later...

Hi Rob,

Try setting your alpha to mid grey, then output to dxt5. When in unigine set blending modes to src alpha, and one minus src alpha. (no alpha test). This will give you control of the alpha slider in the colour setting on the parameters panel and give you more control.

 

Hope this helps.

 

For some reason my entire model will become transparent while only parts need to be transparent...anyone know how to fix this?

I added a screnshot of the issue, seems to be some sort of z sorting issue but I dont have a clue of how to fix it

I already tried to change the Order values but this didnt help

 

 

post-509-0-65562900-1364383696_thumb.jpg

Link to comment

Nice tutorial Nat, i think there should be a Tutorials section added to the forums - it may encourage others to take the time to share things also.

Link to comment

Hi Rob,

I can't be certain without the the material, texture and geometry in front of me to pick at.

Things to try:

 

Is depth mask checked? (also not sure about the hexagonal anomaly in centre, maybe fresnel related?) 

 

I did mean to edit the above post you quoted;

*you should use full white alpha, (instead of mid grey), if you intend to use the alpha slider parameter.

 

If you want parts of the material to be opaque and parts to be transparent you need to control that not from the slider, but from the alpha channel values in your texture. (As soon as you use the alpha value slider in the diffuse_colour colour, then even the white alpha'd parts will become transparent dependant on the slider position, when using src alpha and one minus src alpha.

 

Hope this helps.

Link to comment

Hi Rob,

I can't be certain without the the material, texture and geometry in front of me to pick at.

Things to try:

 

Is depth mask checked? (also not sure about the hexagonal anomaly in centre, maybe fresnel related?) 

 

I did mean to edit the above post you quoted;

*you should use full white alpha, (instead of mid grey), if you intend to use the alpha slider parameter.

 

If you want parts of the material to be opaque and parts to be transparent you need to control that not from the slider, but from the alpha channel values in your texture. (As soon as you use the alpha value slider in the diffuse_colour colour, then even the white alpha'd parts will become transparent dependant on the slider position, when using src alpha and one minus src alpha.

 

Hope this helps.

 

Depth map is checked, it seem all of the non transparent shapes in the scene are somehow seen through the objecy, im using a normal mesh_base material and the mesh is divided in the following parts:

Building, Plants, Airco Units, Neon signs, Sun protection thingies and tables/chairs

 

So what you are saying is I need 100% black and 100% white when I use src alpha and dest one minus src alpha?

I dont really need the sldier but for example I want the background of the plants to be 100% transparent and the neon lights only about 50% transparent, same goes for the glass panes etc

 

If its usefull I could pack up the material and mesh and attach it here

 

Thanks for the help so far

Link to comment

So what you are saying is I need 100% black and 100% white when I use src alpha and dest one minus src alpha?

No magic here. 100% black in the texture = opaque, 100% white = transparent, so for 50% transparency it should be 50% alpha.

And yes, if you tweak the Diffuse color->Alpha slider, all values are affected. So do not use it, bake necessary alpha values into a texture instead.

Link to comment
  • silent unpinned this topic
×
×
  • Create New...