Ooops
May 30, 2020, 03:53:25 AM

Author Topic: Alpha broken in latest OpenB3D release?  (Read 1028 times)

Offline Kippykip

  • Full Member
  • ***
  • Posts: 117
    • Kippykip Forums!
Alpha broken in latest OpenB3D release?
« on: January 25, 2019, 08:50:37 AM »
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 :(

Offline Kippykip

  • Full Member
  • ***
  • Posts: 117
    • Kippykip Forums!
Re: Alpha broken in latest OpenB3D release?
« Reply #1 on: January 25, 2019, 11:56:26 AM »
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?)

Code: [Select]
TBlitz2D.BeginMax2D(version)
TBlitz2D.EndMax2D(version)
to:
Code: [Select]
TBlitz2D.BeginMax2D()
TBlitz2D.EndMax2D()


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

Offline markcwm

  • Sr. Member
  • ****
  • Posts: 453
Re: Alpha broken in latest OpenB3D release?
« Reply #2 on: January 26, 2019, 04:36:02 AM »
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.

Offline Kippykip

  • Full Member
  • ***
  • Posts: 117
    • Kippykip Forums!
Re: Alpha broken in latest OpenB3D release?
« Reply #3 on: January 26, 2019, 04:47:44 PM »
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.

Offline markcwm

  • Sr. Member
  • ****
  • Posts: 453
Re: Alpha broken in latest OpenB3D release?
« Reply #4 on: January 26, 2019, 08:25:39 PM »
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.

Offline Kippykip

  • Full Member
  • ***
  • Posts: 117
    • Kippykip Forums!
Re: Alpha broken in latest OpenB3D release?
« Reply #5 on: January 30, 2019, 01:12:29 PM »
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 :)

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal