Prison Architect

Prison Architect

Not enough ratings
Lenticular Float32 1.2b BETA
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
9.420 KB
14 Dec, 2020 @ 8:48am
17 Dec, 2020 @ 7:40am
5 Change Notes ( view )

Subscribe to download
Lenticular Float32 1.2b BETA

Description
Dynamic lighting shaders by jjwalker - Version 1.2 Beta rev. F3 - Released 12/17/2020

1.2 Beta is a total rewrite from previous versions, should be compatible with all hardware. I am now passing the lightmaps through the dynamic lighting instead of adding the dynamic lighting to the lightmaps. I have also added Normal mapping (not to be confused with bump mapping). See notes in source code for more information!

1.2 Beta rev. F3 Changes:
- We are now at OpenGL version 3.3! Compiled with 0 errors, 0 warnings. I plan to stay at 3.3 as to not exclude older hardware and this version should fit any future needs I have.
- Optimized a couple of other things. I am starting the process of converting Divide operations to Multiply/Multiply Add where floating point rounding error is of no consequence. MUL and MAD instructions can execute up to 6X faster in some cases (it is hardware dependent but always faster). Unit Vectors will be left alone where rounding errors are unacceptable and full 32bit precision is needed.
- No longer sharing variables aross multiple conditionals. Since we now have code branching, conditionals can now save us resources instead of waste them!
- Added lot's of comments and full explanations of just about how every piece of code works and why I do this or that. If you are interested in GLSL or C language based variants, take a look at the source code.

I will continue to optimize and refine along with starting to work on some improvements, in the mean time PLEASE if something weird happens or if something doesn't
look right, please leave me a comment! Your graphics card manufacturers driver compiles this code at runtime based on what hardware you have, so just because
it works on my Nvidia GTX960 doesn't mean it will be bug free on yours.

1.2 Beta rev. F2 Changes:
- Removed a couple of unused but declared variables that will cause errors in a dumb compiler (Intel Integrated Graphics specifically).
- Began removing functions deprecated in OpenGL 3.0
- Optimized a few lines of code that 100% assuredly working - Saves about 4,000 GPU cycles per frame (if Super Sampled) and half that without SSAA

1.2 Beta rev. F1 Changes:
- Fixed lightmap.vs(0x56) attenuation variable error (implicit vec2 to float). Was not a visible error but the compiler caught it.

1.2 Beta rev. E Changes:

- Shadows are now completely fixed!
- Base game runs OpenGL 2.0 compatibility mode, I have updated it to OpenGL 3.0 Core
- The performance improvement by updating OpenGL is substantial
- Fixed Z fighting - if an object still exhibits this behavior on a prior save, re-position the object and It'll fix it.
- New prisons shouldn't exhibit this behavior any longer.

The difference is rather extreme because now we are running as many operations as we currently can on the GPU as opposed to the CPU. Subscribe, I promise you'll fall out of your chair.

Upcoming Features:
- rewriting large portions of the code to allow yet further OpenGL upgrade compatibility. This should raise performance even further as we are now taking advantage of built in GPU hardware acceleration instead of the CPU trying emulate 12yr. old legacy code that is no longer native on modern hardware. Going to OpenGL Core 3.0 already makes an extreme difference.

I promise, subscribe and fix your game. I almost fainted when I realized the performance increase!
33 Comments
megatails 4 Jul, 2021 @ 10:34pm 
not working for me. with only the mod, there are a lot of squares appearing on the scenario, and when I apply a texture mod, it becomes a bunch of white squares
jjwalker  [author] 23 Feb, 2021 @ 6:21pm 
I am going to finish the last bit of this and make it 2.0 status soon...

I kind of got fed up with Paradox and just ditched it and had to be away for a while. I do believe however, my displeasure with Paradox should have bearing on completing this.

So stay tuned for 2.0 to be available (This item will automatically to 2.0 when complete).

I hope the few of you using this fix of Paradox's complete disregard for the PC community and fixing their game enjoyable and pleasant. I did it for ya'll, I did it to try and save a game I really love. But the has to be an end.

Thank you Friends!
jjwalker  [author] 12 Jan, 2021 @ 9:06am 
@SagLysa88

No, this is strictly for rendering and performance. Specifically, I added dynamic lighting and effects while improving performance by roughly 300% in some cases.

Your cooks might still be buggy, but at least the game will render quickly :)
SagLysa88 11 Jan, 2021 @ 6:46pm 
Sorry if this has already been asked or addressed, but will this solve or at least help with thee issues with the chefs and the kitchen bugs?
jjwalker  [author] 31 Dec, 2020 @ 8:40am 
I am really trying to polish this up and if it is bug free, it is going to go straight v1.3 instead of 1.2 Beta Rev. F4
I think that once it is done, it will be done. I don't know what else I could possibly add to it at this point without either 1) disturbing it's 2D nature, it's a 2D sprite game and that is what makes it fun. 2) Detracting from what the original goal was.
This mod was originally supposed to just make the game playable beyond the smallest map, and as usual with any project I do, it got expanded but I think it was for the better. I think once this is done, it'll be really the perfect balance of speed and visuals without ruining the 2D sprite atmosphere. So far, I have made the game 300% faster in some cases and the additional eye candy is being done carefully to keep it that way. I just don't see what else I could add or if I added it, keeping that speed increase... So soon, I want this to be great, bug free, and complete.
- I'll keep ya'll posted. :)
jjwalker  [author] 23 Dec, 2020 @ 8:17pm 
1.2 Rev. F4 progress notes:
I am delayed again because I have been implementing some neat stuff.
I've added..
-Shader based MSAA - Very fast because I am sampling neighbor pixels as they run through the GPU's pipeline, so thus it is very cheap. Pixels are shaded in 2x2 batches so sampling a neighboring pixel while "in-flight" is extremely fast. This greatly reduces texture aliasing while moving the camera.
- Variance based shadows - in progress and while working, need tweaking.
- Per pixel shadows and post process filter - I found I can use the final pass used for shadows for post process. I have a form of self shadowing going on which was the result of a mistake (one I am glad I made, lol). Pictures are in the link below and the results are startling.

https://forum.paradoxplaza.com/forum/threads/lenticular-float32-mod-official-thread.1445090/post-27185216
jjwalker  [author] 22 Dec, 2020 @ 8:03am 
Another day late...

I am trying to solve a floating point rounding error but if I am unable to do so by this afternoon, it is getting the update. The error does not break anything and you won't notice it unless you are looking for it. I say error, it really isn't, it's just an oddity caused by floating number rounding.
jjwalker  [author] 21 Dec, 2020 @ 8:05am 
A sudden migraine stopped me in my tracks yesterday...

For sure being updated today, see my comment below this one.
jjwalker  [author] 20 Dec, 2020 @ 1:53pm 
Update on 1.2 Beta rev. F4
I believe (hoping) that it will be ready late late tonight, don't forget I am UTC-6.
So far the changes are as follows
- 80% optimized (as of right now as I am typing)
- FAR better GPU pipeline utilization - 50% less VRAM usage and eliminated multiple samples of the same texture for a single fragment
- Long warp stalls almost 0 (stalls happen, but less is better) Warps are 32 thread batches that execute simultaneously. The AMD equivalent is "wavefront".
- SM cores achieve up to 98% saturation - Derived from (Warps * SM Cores - unused cores).
The post below this details a few things better, but I'll get further into it when the update is released.
jjwalker  [author] 20 Dec, 2020 @ 9:19am 
So, 1.2 Beta rev. F4 has almost exclusively been optimization and frame profiling. Where I am at this very moment, the GPU pipeline is VERY efficient. Before ( rev. F3 and prior) it was split into 3-4 chunks computing or otherwise stalled. I have got this down to essentially 2 chunks, which is really the minimum anyway. One "draw vertices" and one really large "Shade pixels". That is simplified but it translates to a savings of almost 50% less VRAM usage. Our "long warp stall" is 0% most of the time, down from 8-15% before. FPS and frame time are essentially the same but we are also not missing any monitor refreshes (less gsync or freesync, your monitor refreshes whether you are ready for it to do so or not).