WIP: glsl/normal: use ifdef for normal z reconstruction#189
WIP: glsl/normal: use ifdef for normal z reconstruction#189illwieckz wants to merge 2 commits intoDaemonEngine:masterfrom
Conversation
|
A couple suspicious things:
|
good catch!
right, this code is not yet used but it's better to not have bugs in dormant code I'll reread the stuff to be sure this variable is set in any code that use normal map (they may be more), not only those that use parallax. |
be340e6 to
d87652a
Compare
|
I rebased on master but the #190 bug is still there so merge is blocked |
|
It looks like in some shaders, you are doing |
523a6fb to
48a0893
Compare
|
do someone can explain me why the latest commit is fixing the bug? |
48a0893 to
e566f7b
Compare
|
Do you really need the 2nd commit for it to work? It looks like the first one was changed to avoid the bug that I talked about before. |
|
Yes, the second commit is required to fix the bug. The changes I added to the first commit to fix the issue you talked about before is not enough. It's also why I kept this second commit separate to be able to ask the question. 😛 |
e566f7b to
9999400
Compare
|
Well, that only fixes it for now, if I add some commits editing some unrelated stuff the bug comes back again… the unrelated commit I was working on was a commit merging reflection in lightmap stage to avoid double parallax compute… this one added a macro since the reflectCube glsl would be useless in that case, and the bug came back… I know the macro thing is tricky since each macro is a bit of one integer, may be we overflow that integer because of “too many macro”? There is a check about that “too many macro” scenario but I never triggered it so I suspect it does not work. In some WIP earlier commits I had a lot of macros and I was wondering why the "too many macro" test was not shooting at me… |
|
@slipher, note that Daemon/src/engine/renderer/gl_shader.h Line 33 in fb8b561 |
|
But I never get this error in any way: Daemon/src/engine/renderer/gl_shader.h Lines 201 to 204 in fb8b561 |
|
This may be a bug similar to the one fixed in #211 |
no renaming in gl code because one day it will use a macro definition in any way, see DaemonEngine#189
about renaming heightMapInNormalMap as hasHeightMapInNormalMap: there is no no renaming in gl code because one day it will use a macro definition in any way, see DaemonEngine#189
also make USE_HEIGHTMAP_IN_NORMALMAP a macro, obsoletes DaemonEngine#189
|
This will be obsoleted by my PR introducing loose heightmap support. I'm not sure there is a bug in that ifdef code, similar artifact can happen with zero normalscale (hence undefined normalscale). I noticed some issues with that other feature, so maybe it's the same. |
about renaming heightMapInNormalMap as hasHeightMapInNormalMap: there is no no renaming in gl code because one day it will use a macro definition in any way, see DaemonEngine#189
also make USE_HEIGHTMAP_IN_NORMALMAP a macro, obsoletes DaemonEngine#189
also make USE_HEIGHTMAP_IN_NORMALMAP a macro, obsoletes DaemonEngine#189
about renaming heightMapInNormalMap as hasHeightMapInNormalMap: there is no no renaming in gl code because one day it will use a macro definition in any way, see DaemonEngine#189
also make USE_HEIGHTMAP_IN_NORMALMAP a macro, obsoletes DaemonEngine#189
also make USE_HEIGHTMAP_IN_NORMALMAP a macro, obsoletes DaemonEngine#189
about renaming heightMapInNormalMap as hasHeightMapInNormalMap: there is no no renaming in gl code because one day it will use a macro definition in any way, see DaemonEngine#189
about renaming heightMapInNormalMap as hasHeightMapInNormalMap: there is no no renaming in gl code because one day it will use a macro definition in any way, see DaemonEngine#189
also make USE_HEIGHTMAP_IN_NORMALMAP a macro, obsoletes DaemonEngine#189
about renaming heightMapInNormalMap as hasHeightMapInNormalMap: there is no no renaming in gl code because one day it will use a macro definition in any way, see DaemonEngine#189
also make USE_HEIGHTMAP_IN_NORMALMAP a macro, obsoletes DaemonEngine#189
also make USE_HEIGHTMAP_IN_NORMALMAP a macro, obsoletes DaemonEngine#189
also make USE_HEIGHTMAP_IN_NORMALMAP a macro, obsoletes DaemonEngine#189
about renaming heightMapInNormalMap as hasHeightMapInNormalMap: there is no no renaming in gl code because one day it will use a macro definition in any way, see DaemonEngine#189
also make USE_HEIGHTMAP_IN_NORMALMAP a macro, obsoletes DaemonEngine#189
about renaming heightMapInNormalMap as hasHeightMapInNormalMap: there is no no renaming in gl code because one day it will use a macro definition in any way, see DaemonEngine#189
also make USE_HEIGHTMAP_IN_NORMALMAP a macro, obsoletes DaemonEngine#189
also make USE_HEIGHTMAP_IN_NORMALMAP a macro, obsoletes DaemonEngine#189 About the collapse code collapsing heightmap stage while heightmap is a pre-colapsed stage attribute: > @slipher: The commit message says the heightmap is a per-stage attribute, but this looks like it's in a stage by itself? > @illwieckz: The dpMaterial DarkPlaces compatibility layer is not yet ported to the pre-collapsed stage code and I'm using Xonotic assets to test this feature, hence the temporary requirement to collapse a standalone heightmap stage. There is no keyword available to mapper to use the standalone heightmap stage, only the per-stage attribute, so there is no chance a mapper uses the standalone heightmap stage by mistake and we can drop it one day. DaemonEngine#252 (review)
also make USE_HEIGHTMAP_IN_NORMALMAP a macro, obsoletes DaemonEngine#189 About the collapse code collapsing heightmap stage while heightmap is a pre-colapsed stage attribute: > @slipher: The commit message says the heightmap is a per-stage attribute, but this looks like it's in a stage by itself? > @illwieckz: The dpMaterial DarkPlaces compatibility layer is not yet ported to the pre-collapsed stage code and I'm using Xonotic assets to test this feature, hence the temporary requirement to collapse a standalone heightmap stage. There is no keyword available to mapper to use the standalone heightmap stage, only the per-stage attribute, so there is no chance a mapper uses the standalone heightmap stage by mistake and we can drop it one day. DaemonEngine#252 (review)
DO NOT MERGE until the
#ifdefbug is fixed, see #190.This is a simple change that makes glsl relying on
#ifdefinstead of anuniformto test for the fact the normalmap is embedding heightmap in alpha channel or not. This makes GMA965 able to render parpax default scene with11fps instead of10(+10%) (unnoticeable on R9 390X).This is not merged yet because of a nasty bug, it looks like the define is not defined any time as while I move in map, the wrong code is sometime run instead of the expected one:
The bug is on the wall texture, not on the blooming reactor.
I reproduced the bug on both
radeonsi(R9 390X) andi965(Haswell) drivers, this is likely to not be a driver bug but a bug in dæmon code, the ifdef code is very cryptic and would benefit a lot from a rewrite.I'm basically pushing this branch so people have code to debug the
#ifdefbug (#190).