GLES: Palette emulation does not work

Moderator: Raze Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48041
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

GLES: Palette emulation does not work

Post by Graf Zahl »

Since the entire shader code comes from GZDoom it logically does not have the palette emulation shader and trying to enable the feature resulted in a softlock, so I had to disable it for now.

I'm not sure if this is worth fixing, I'm leaving it to emile_b.
emile_b
Posts: 98
Joined: Sun Sep 22, 2019 7:06 am
Graphics Processor: nVidia (Modern GZDoom)

Re: GLES: Palette emulation does not work

Post by emile_b »

Thanks, I should get this working for Raze GLES. Yep I need to update func_paletted.fp, looks like I will need to replace 'texelFetch' as it does not exists in GLES 2.
Will take a look.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48041
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: GLES: Palette emulation does not work

Post by Graf Zahl »

Maybe you can have a look at EDuke32's shader. That one tried to do the whole thing without branching but in return was close to unreadable.
emile_b
Posts: 98
Joined: Sun Sep 22, 2019 7:06 am
Graphics Processor: nVidia (Modern GZDoom)

Re: GLES: Palette emulation does not work

Post by emile_b »

Graf Zahl wrote:Maybe you can have a look at EDuke32's shader. That one tried to do the whole thing without branching but in return was close to unreadable.
Haha yes, good idea I'll see how they compare. I have been working through the eduke32 render code the past week.. taking a while to get my head fully around that 10K line polymost.cpp file :shock:
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48041
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: GLES: Palette emulation does not work

Post by Graf Zahl »

I have to admit that I failed at understanding half the math in it. It's surely quite the thing...
emile_b
Posts: 98
Joined: Sun Sep 22, 2019 7:06 am
Graphics Processor: nVidia (Modern GZDoom)

Re: GLES: Palette emulation does not work

Post by emile_b »

OK I did a fix here:
https://github.com/coelckers/Raze/pull/562

It should work on PC but it not technically GLES compatible because it still uses the texelFetch function which is not present in GLES 2.0. I will do another update when I update Raze-Touch, but this should work for now.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48041
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: GLES: Palette emulation does not work

Post by Graf Zahl »

Hm. I just did a hotfix release this morning without palette mode. So, probably next weekend.
emile_b
Posts: 98
Joined: Sun Sep 22, 2019 7:06 am
Graphics Processor: nVidia (Modern GZDoom)

Re: GLES: Palette emulation does not work

Post by emile_b »

Yep I saw no worries, I might have updated with GLES 2.0 compatible code by then anyway.
User avatar
mjr4077au
Posts: 720
Joined: Sun Jun 16, 2019 9:17 pm
Graphics Processor: nVidia with Vulkan support
Location: Gosford NSW, Australia

Re: GLES: Palette emulation does not work

Post by mjr4077au »

@emile_b, I've re-opened this as it was marked as fixed, but if I revert the guards added to prevent palette emulation for OpenGL ES in 8d9d3d5f, the engine hangs.

Just wondering if this is something you could take a look at sometime in the future?
emile_b
Posts: 98
Joined: Sun Sep 22, 2019 7:06 am
Graphics Processor: nVidia (Modern GZDoom)

Re: GLES: Palette emulation does not work

Post by emile_b »

mjr4077au wrote:@emile_b, I've re-opened this as it was marked as fixed, but if I revert the guards added to prevent palette emulation for OpenGL ES in 8d9d3d5f, the engine hangs.

Just wondering if this is something you could take a look at sometime in the future?
Hi, I just tried with latest master and reverted changed from that commit and it seems to work for me. Which game are you trying? Are you compiling for a PC or something else?

When I toggle the pallet emulation on/off I can see the shading slightly change so I think its working.
User avatar
mjr4077au
Posts: 720
Joined: Sun Jun 16, 2019 9:17 pm
Graphics Processor: nVidia with Vulkan support
Location: Gosford NSW, Australia

Re: GLES: Palette emulation does not work

Post by mjr4077au »

I'm trying on a PC and when I do, I soft lock the engine still. This was in Duke 3D.
emile_b
Posts: 98
Joined: Sun Sep 22, 2019 7:06 am
Graphics Processor: nVidia (Modern GZDoom)

Re: GLES: Palette emulation does not work

Post by emile_b »

Humm, ok I'll try the executable on another PC. Do you have your ini file also? Maybe combination of some setting.
User avatar
mjr4077au
Posts: 720
Joined: Sun Jun 16, 2019 9:17 pm
Graphics Processor: nVidia with Vulkan support
Location: Gosford NSW, Australia

Re: GLES: Palette emulation does not work

Post by mjr4077au »

Shouldn't be anything detrimental in here, but admittedly I did not try a clean config either.
raze-mjr40.ini
You do not have the required permissions to view the files attached to this post.
emile_b
Posts: 98
Joined: Sun Sep 22, 2019 7:06 am
Graphics Processor: nVidia (Modern GZDoom)

Re: GLES: Palette emulation does not work

Post by emile_b »

Thanks for that, still works for me with that .ini.

This is a copy of the build I am using:
https://drive.google.com/file/d/1B4-KFU ... sp=sharing

It would be interesting to see if this behaves any differently (I understand if you don't want to run it however)
emile_b
Posts: 98
Joined: Sun Sep 22, 2019 7:06 am
Graphics Processor: nVidia (Modern GZDoom)

Re: GLES: Palette emulation does not work

Post by emile_b »

Its probably some change I did the in the shader which works on my GPU and not yours. I'll try and remove anything slightly strange in it.

Return to “Closed Bugs”