Opaque texture bug

Hi, I’ve isolated this as best as I can and made the playground example of the bug as simple as i thought made sense to.

https://playground.babylonjs.com/#S0P31H#4

if you move the camera towards the moon (its only 70 away) the moon will suddenly become properly opaque when you are about half way to it.

if you move the position of the moon (mesh plane) farther or closer . the cutoff distance for “full opaque” changes. It all seems relative to the plane facing the origin, but not the center of the plane… if you go way off to the side but are still close enough to the plane it is opaque. in fact if you make the plane two sided you can go anywhere on the back side and it is opaque.

This has been an endless time sink for me as i was just trying to add nice anti aliasing on my moons via an opaque texture with multiple skyboxes where 1 skybox is partially see through.

let me know if i can provide any information or help in anyway.

It’s actually not a bug. Play with alphaIndex of skybox and moon mesh. You can read how visibility works, and why alphaIndex help in this situation here

2 Likes

You can also just call this

1 Like

I did actually try that briefly. but this is all new to me and i had added an index to the moon thinking that if it was lower it would be processed at a different time and that would be enough. I didn’t realize the skybox actually has to be lower for this to work. (i frankly dont quite get why camera distance isnt enough… sometimes, but its fine, i can set the skybox index to a nice low number. thanks for clearing this up!