Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

renderer: revive liquid shader (currently disabled because it is broken) #256

merged 4 commits into from Jan 6, 2020


Copy link

illwieckz commented Dec 26, 2019

By making this code live again, we make easier to not introduce bugs in this code.

A cvar is available for adventurous people to debug the feature, named r_liquidMapping, disabled by default.

The specular code is refactored against the one in computeLight library.


This comment has been minimized.

Copy link
Member Author

illwieckz commented Dec 26, 2019

The glsl code itself seems to not be broken, I don't know if the glsl compute is correct, but the glsl shader is not broken.

The glsl shader produce garbage because it receives undefined content as input, from there:

// capture current color buffer
GL_SelectTexture( 0 );
GL_Bind( tr.portalRenderImage );
glCopyTexSubImage2D( GL_TEXTURE_2D, 0, 0, 0, 0, 0, tr.portalRenderImage->uploadWidth, tr.portalRenderImage->uploadHeight );

Instead of “current color buffer” this code captures some random video memory (likely to be filled with leftovers, even from the desktop):

liquid shader fed with random video memory

When some dummy colors and normal maps are given to glsl shader but the tr_backend code is still capturing random video memory, we see the glsl shader does things:

liquid shader fed with random video memory and dummy colors

@illwieckz illwieckz force-pushed the illwieckz:liquid branch 3 times, most recently from 6ddb29d to 9bb7033 Dec 26, 2019

This comment has been minimized.

Copy link
Member Author

illwieckz commented Dec 31, 2019

Does anyone have something against something in this PR?

This patch changes nothing on how currently supported things are currently rendered, but this change is required to clean and refactor the code (and maybe fix bugs).

@illwieckz illwieckz force-pushed the illwieckz:liquid branch 2 times, most recently from 92971f4 to f352d16 Dec 31, 2019
slipher approved these changes Jan 5, 2020
@illwieckz illwieckz merged commit 0d3d97f into DaemonEngine:master Jan 6, 2020
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
continuous-integration/travis-ci/pr The Travis CI build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.