Transparency minimum value?

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
User avatar
Phitt
Posts: 442
Joined: Tue Aug 14, 2012 9:43 am

Transparency minimum value?

Post by Phitt »

I noticed that even with a RGB value of 0,1,1 in the alpha channel transparent surfaces are still quite visible. It also seems that transitions between values are quite rough so you can't really make a soft fade out. Here is an example of what I mean, as you can see the 'light cone' is still quite visible and looks almost solid despite having the RGB value I mentioned above.

I used Translucent as blend mode and alpha test true. Is there any way to get a smoother form of transparency and more transparency in general (so transparent surfaces are hardly visible anymore)?
User avatar
petri
Posts: 1917
Joined: Thu Mar 01, 2012 4:58 pm
Location: Finland

Re: Transparency minimum value?

Post by petri »

What do you mean by 0,0,1 in the alpha channel? Alpha channel is a scalar value channel and have values in range 0-255.

Using translucency with alpha-testing is not a typical use case. Translucency is smooth blending with 256 transparency levels, alpha-testing is 1 bit on/off transparency. The threshold for alpha-testing is at 128, so alpha values below 128 will be clipped off and alpha values greater than 128 are fully opaque. Combining both translucent blending and alpha-testing results in a weird combination (I don't think there's any materials in LoG2 that uses them both in the same material).

Looking at your image, I think Additive blending with very low RGB values would probably work better for light shafts. After all light shafts are formed when light is scattered towards your eye by dust particles in the air, which is largely an additive phenomenon.
User avatar
Phitt
Posts: 442
Joined: Tue Aug 14, 2012 9:43 am

Re: Transparency minimum value?

Post by Phitt »

Alpha testing did work for some reason though in combination with translucent blending or better said it didn't work - whether it is turned on or off gives the same result. With additive the transitions look a bit better, but the minimum opacity (which would be 1 in the alpha channel with translucent and 1,1,1 in the RGB channel with additive) is still as shown on my screenshot. I guess the way transparency works in LoG isn't ideal for creating light shafts. Thought it would have been a nice effect (one I used quite often while modding Elder Scrolls games, which had their own share of problems with transparency), but it doesn't matter much. But thanks for the explanation, I didn't know this!
Post Reply