Alpha broken in latest OpenB3D release?

Started by Kippykip, January 25, 2019, 08:50:37

Previous topic - Next topic

Kippykip

I just upgraded my project to the latest version of OpenB3D ;), but now the Alpha on everything is messing up. I find if I use TextureFilter("", 1 + 2) I can get some objects to load with alpha. But not on anything loaded with LoadTexture. 3DS models have the alpha broken aswell.
Here are some screenshots from my project, I found changing the Graphics3D flag made some slightly different results.



Seems the last few OpenB3D updates have been doing some funny things to Alpha :(

Kippykip

I think I found the culprit, I downloaded a bunch of versions one by one in attempt to find what's causing the alpha issues.
https://github.com/markcwm/openb3dmax.mod/commits/master

Commit 1164a24 was the last version to having working transparency.
Couldn't test Commit 4058426 as it crashes with a Log2 function error or something.
And commit ecef7ef is where alpha textures broke.

The fault seems to be related to TBlitz2D.bmx, as replacing it with the version from commit 1164a24 completely fixes it.
Although you'll have to make a slight edit to openb3dmax.bmx due to the new "version" parameter. (when using version = 0 on the latest TBlitz2D.bmx, the alpha problem persisted?)

TBlitz2D.BeginMax2D(version)
TBlitz2D.EndMax2D(version)
to:
TBlitz2D.BeginMax2D()
TBlitz2D.EndMax2D()



Here's my project working again! Hope this helps track down this bug further :D

markcwm

Hi KippyKip,

I'm not able to reproduce this so I just had a guess and edited Begin/EndMax2D to remove disable gl_blend maybe that will help. I don't really have a proper model with alpha to test with and couldn't find one, other than the lightmap, alphamap and particle examples which don't seem to have any problems. It's strange that using BeginMax2D(0) isn't working either.

Kippykip

Quote from: markcwm on January 26, 2019, 04:36:02
Hi KippyKip,

I'm not able to reproduce this so I just had a guess and edited Begin/EndMax2D to remove disable gl_blend maybe that will help. I don't really have a proper model with alpha to test with and couldn't find one, other than the lightmap, alphamap and particle examples which don't seem to have any problems. It's strange that using BeginMax2D(0) isn't working either.

Welp, whatever you did that fixed it! :) Just tested the latest version.

markcwm

I'm glad it works now, it was the new EndMax2d disabling blending after the stack was restored, blending is not set every render, which is probably an optimization trick.

Kippykip

Quote from: markcwm on January 26, 2019, 20:25:39
I'm glad it works now, it was the new EndMax2d disabling blending after the stack was restored, blending is not set every render, which is probably an optimization trick.
Ah that explains why the clouds were solid white :)