bibendovsky / bstone

Unofficial source port for Blake Stone series
Other
296 stars 34 forks source link

Alpha blending on Odroid N2+ #389

Open miwasp opened 2 years ago

miwasp commented 2 years ago

I compiled bstone for the Odroid N2+. This device has an Amlogic S922x CPU and a Mali G52 GPU. When starting with renderer "auto-detect" it looks like this:

bstone_n2

Somehow all the walls are transparent. This must be something special with the GPU and how it handles alpha blending. So i wanted to switch to renderer "software" but this doesn't work either. Error messages is:

[VIDSW] Creating window. [VIDSW] [VIDSW] Initializing renderer. [VIDSW] Available renderer drivers: [VIDSW] 1. opengles2 [VIDSW] 2. opengles [VIDSW] 3. software [VIDSW] Using VSync. [VIDSW] Creating renderer. [ERROR] [VID] [SDL] Renderer already associated with window [CRITICAL] [SDL] Renderer already associated with window

Any advice on how to get bstone running on this device?

bibendovsky commented 2 years ago

I don't think it is blending issue. Wall or door does not have transparancy attribute.

Got same picture with regular OpenGL after disabling depth test here (changed true to false).

You can try to comment or remove this line to check if it is a problem with cached value. Otherwise I don't know how to help.

As for software rendrering try to build the latest commit of develop branch. Messages from your log indicates you are probably using master branch or commit before high-level renderers were revised.

miwasp commented 2 years ago

Got same picture with regular OpenGL after disabling depth test here (changed true to false).

Looks the same with trueor false on this hardware.

You can try to comment or remove this line to check if it is a problem with cached value. Otherwise I don't know how to help.

Sadly makes no difference, still looks the same. As for software rendrering try to build the latest commit of develop branch. Messages from your log indicates you are probably using master branch or commit before high-level renderers were revised.

Built the latest commit of branch develop, messages look a little bit different, but result is the same:

[VIDSW] Available renderer drivers: [VIDSW] 1. opengles2 [VIDSW] 2. opengles [VIDSW] 3. software [ERROR] [VID] [SW_VIDEO] SwVideo [CRITICAL] [VIDEO] VL_Startup [SW_VIDEO] SwVideo [SW_VIDEO] initialize_video [SW_VIDEO] initialize_renderer [SDL] Renderer already associated with window

bibendovsky commented 2 years ago

Built the latest commit of branch develop, messages look a little bit different, but result is the same:

Probably it's because of SDL_GetWindowSurface. There is a note in remarks: "You may not combine this with 3D or the rendering API on this window". Try to remove/comment this line.

miwasp commented 2 years ago

Strike. After commenting the line, the software renderer works. Will this find its way into your repo or is this something special on this hardware?

Thank you very much!

bibendovsky commented 2 years ago

Will this find its way into your repo or is this something special on this hardware?

I'll add the fix.

bibendovsky commented 2 years ago

SDL error fixed (#390).

bibendovsky commented 2 years ago

@miwasp Could you check if the one of the following changes fixes the problem with OpenGL ES renderer?

miwasp commented 2 years ago

Sure. First tried uncommenting the define and built with CMAKE_BUILD_TYPE "Debug".

Second tried to replace 0 with 16, this time built as "Release".

In both cases the result was the same (transparent walls).

I have not tried both changes at once. If this makes sense, i could do that too.