implement r_deluxeMapping, r_specularMapping, r_glowMapping etc.#188
implement r_deluxeMapping, r_specularMapping, r_glowMapping etc.#188illwieckz merged 11 commits intoDaemonEngine:masterfrom
Conversation
|
If I understand correctly, each one of {r_deluxeMapping, r_specularMapping, r_glowMapping} is implemented as a switch that can be individually turned on or off for each texture? Maybe it would make more sense to make this a global variable (requiring a renderer restart to change) so that it does require 2x as many variants of each GLSL shader to be compiled. |
|
right |
|
Note that we can't do Edit: And there is no easy way to set a fallback. There was an |
|
Uh no! those defines look to be set once for all at startup. The |
|
Note that more code disablement is to be done. Because of those macros being for all the materials and not per-material, I had to light & specular stuff from |
ca1e154 to
32c08d8
Compare
|
LGTM |
|
@slipher can you look at the latest commit I added? I just noticed I forgot to include this one in this PR while extracting some commits from my workspace to branches for other PR to come. This is very straightforward, it just uses parallaxDepth/Offset thing in reliefMapping_fp only hence no need to pass the variables anywhere parallax is done hence there is only one place to put ifdef. Basically they are defined where they are used. This avoids boiler plate. |
|
👍 |
probably none will shed a tear
simplifies the code, only requires ifdef at one place
|
I just force pushed because I squashed this very minor thing (both are diff --git a/src/engine/renderer/glsl_source/liquid_fp.glsl b/src/engine/renderer/glsl_source/liquid_fp.glsl
index 7154718c8..ac7a19099 100644
--- a/src/engine/renderer/glsl_source/liquid_fp.glsl
+++ b/src/engine/renderer/glsl_source/liquid_fp.glsl
@@ -90,7 +90,7 @@ void main()
// calculate the screen texcoord in the 0.0 to 1.0 range
vec2 texScreen = gl_FragCoord.st * r_FBufScale;
- vec2 texNormal = var_TexNormal.st;
+ vec2 texNormal = var_TexNormal;
#if defined(USE_PARALLAX_MAPPING)
// ray intersect in view direction |
Some code that implements
r_deluxeMapping,r_specularMappingandr_glowMapping.It's made the way we can disable normal mapping while keeping deluxe mapping.
Of course disabling deluxe mapping disable normal mapping too.
It's made the way we can disable normal mapping while keeping parallax mapping.
Some glsl code is not compiled when some features are disabled. More disablements will be done in future PRs, but this already makes a GMA965 going from
10fps to15fps while rendering the parpax default scene (spectator intermission) which is already 50% more (but this is unnoticeable on R9 390X).Some specular code is refactored the way it's not copy-pasted across multiple files anymore.