Been playing with OpenGL and the Shaders, check this out!

  • We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

jjwalker

Sergeant
Nov 16, 2020
68
5
I have been out of the shader game for a while, worked on STALKER from 2007-2009 but nothing since.

Welp, not anymore :D

I have to fix some errors but check this out :D

I'll share this when I get some stuff ironed out.
 

Attachments

  • PA_shaders1.png
    PA_shaders1.png
    3,3 MB · Views: 0
  • PA_shaders2.png
    PA_shaders2.png
    2,7 MB · Views: 0
So, basically what I am doing is updating the OpenGL shader algorithms to create various effects... I figure since it is 2020 and the game is strictly CPU limited anyway, why not use the video card to do some of the work. The above screenshots and the ones attached to this reply are proof of concept. I have added more detailed shadowing indoors and outdoors, light blending an diffusion and some specular highlights to mimic a small bloom effect of very bright objects (like the white tiles in a bathroom).

This is entirely proof of concept and I have decided to run with it. I need to remove introversions shadowing via the vertex pipeline (if that's possible) since I am now doing it in the fragment shader and also try and add some smoothing so they aren't so stark and hard per se.

The below attached images detail what I mean by light diffusion and specular highlights. You can see some of the blue light from the gym bathroom diffusing out the opening onto the concrete tiles. Also notice the bathroom and the indoor shadowing in general. You'll also notice that the spot lights now blend well with the sunlight during the day. As they are always on, you'll still see that they create a bright spot but now the shader is taking into account that the sun is out instead of just showing a static lightmap. You can also see a good example of the light diffusion from the green grass on the benches and the reflection from a concrete wall illuminating a bench off in the bottom right corner.

So, basically I need to try and discard the shadowing via the vertex pipeline since we are now doing it in the fragment shader, dither and smooth the shadow edges and fix a few other things.

But, as you can see, it can be done! Double 11 hasn't updated the shaders nor the OpenGL implementation at all (they has for the console version though) which I am not bashing them for by any means as this gives me a neat project to work on! :D

I'd like to also note that there is no performance penalty and actually my frame rate went up. I believe if I am successful at removing the old static OpenGL calls, I'll be able to offload more work to the GPU.

As I stated before, I'll share this with yall soon because right now I am still working on it and yall would have an old version within 15 minutes of uploading it :)
 

Attachments

  • PA_shaders3.png
    PA_shaders3.png
    2,7 MB · Views: 0
  • PA_shaders4.png
    PA_shaders4.png
    2,9 MB · Views: 0
  • PA_shaders5.png
    PA_shaders5.png
    3,3 MB · Views: 0
Ok, I finally have something I feel good about sending out. I'll post a download here and on the steam workshop later this evening in central time (UTC -6).
The sun shadows are a bit off now because introversion did that on the CPU side so I still am trying to find a way around them, but they are not broken per se. I do not have a way to interact with them on the shader level at the moment, but hopefully I can find a solution soon. They still work, they just don't interact with the pixel shader correctly. If they are visually unappealing they can be turned off without having an effect on the dynamic lighting.

I also included lots of comments in the shader code explaining what I am doing if you choose to take a look at them.

As I said previously, I'll upload this later this evening.
 

Attachments

  • PA_shaders6.png
    PA_shaders6.png
    3,1 MB · Views: 0
  • PA_shaders7.png
    PA_shaders7.png
    2,5 MB · Views: 0
  • PA_shaders8.png
    PA_shaders8.png
    2,5 MB · Views: 0
  • PA_shaders9.png
    PA_shaders9.png
    2,3 MB · Views: 0
As promised! unzip to the appdata/local/introversion/prisonarchitect/mods/ folder as with any mod.

Update: I have uploaded my mod to the workshop so you can get it there as well.
 

Attachments

  • Lenticular_Float32_v1.0.zip
    5,2 KB · Views: 0
Last edited: