Realistic water node
Re: Realistic water node
Hey elvman,
I really like your water implementation and I would like to see it in action. Would you mind providing some example like the one (similar setup) in the screenshot?
Thanks.
I really like your water implementation and I would like to see it in action. Would you mind providing some example like the one (similar setup) in the screenshot?
Thanks.
Re: Realistic water node
I added usage instructions to the repository: https://github.com/elnormous/RealisticWaterSceneNode
Re: Realistic water node
Hi! elvman.. When I compiled and tested your project it worked fine in DX (HLSL) mode,
but when I ran it in GL(GLSL) mode I got strange water artifacts. (funny light blue effect from the normal map)
I changed the code in "ShaderMaterial" as follows:
but when I ran it in GL(GLSL) mode I got strange water artifacts. (funny light blue effect from the normal map)
I changed the code in "ShaderMaterial" as follows:
Code: Select all
// Approx line 234 in "ShaderMaterial.cpp"..
// Set texture names for OpenGL Shaders
// (this is not necessary for DirectX)
if(userdata == 1)
{for (u32 i=0; i<video::MATERIAL_MAX_TEXTURES; ++i)
{if(Material.TextureLayer[i].Texture != NULL)
// services->setPixelShaderConstant(TextureName[i].c_str(), (f32*) &i, 1); // -- OLD LINE --
services->setPixelShaderConstant(TextureName[i].c_str(), (s32*) &i, 1); // -- NEW LINE --
// I Changed (f32) to (s32) and it worked fine!
}
}
Re: Realistic water node
I'm still trying to figure out how to use the existing shaders along with my object shaders.
Fog is a problem as I have to incorporate it into ALL the shaders.
(not serious and will be solved eventually)
Fog is a problem as I have to incorporate it into ALL the shaders.
(not serious and will be solved eventually)
Re: Realistic water node
This is what happens when you have.
instead of
(f32) should be (s32)..
Code: Select all
services->setPixelShaderConstant(TextureName[i].c_str(), (f32*) &i, 1);
Code: Select all
services->setPixelShaderConstant(TextureName[i].c_str(), (s32*) &i, 1);
Re: Realistic water node
@elvman.. Thanks for sharing this!
I see you can even COMBINE the shaders rendered to the Rendertarget.
Here is my own "underwater" version..
It combines the shaders like this.
I see you can even COMBINE the shaders rendered to the Rendertarget.
Here is my own "underwater" version..
It combines the shaders like this.
Code: Select all
postProcessManager->render(EPPE_UNDER_WATER); // Original O.K ..
postProcessManager->render(EPPE_BLUR); // GLSL O.K. HLSL O.K.
postProcessManager->render(EPPE_RADIAL_BLUR); // GLSL O.K. HLSL O.K.
Re: Realistic water node
And the best part of all is the FXAA! Unbelievable considering it uses only the pixels in the buffers!
(not the traditional slow multiple geometry rendering)
Here is a magnification of what it can do after turning All AA methods OFF in my NVIDIA Controll panel!
Really cool stuff! Thanks elvman!
(not the traditional slow multiple geometry rendering)
Here is a magnification of what it can do after turning All AA methods OFF in my NVIDIA Controll panel!
Really cool stuff! Thanks elvman!
-
- Competition winner
- Posts: 523
- Joined: Tue Jan 15, 2013 6:36 pm
Re: Realistic water node
Yeah if I remember correctly there are some lines that have to be changed to s32 instead of f32.
Re: Realistic water node
I've noticed that the version of this thing I have is not the same as pointed to by the link..
Why is this? Are all those other cool things still available somewhere?
Why is this? Are all those other cool things still available somewhere?
-
- Competition winner
- Posts: 523
- Joined: Tue Jan 15, 2013 6:36 pm
Re: Realistic water node
I just decided to make my own water that way you can implement it any way you like
Re: Realistic water node
@ elvman..(or the_glitch) Hi! The water reflection version with the terrain node and all the other shaders is
quite complex and will take a while to grasp, so I decided to use your
simplified water scene node..
Very cool, but I get a strange offset in the reflected image and
some artifacts on the left side..
What am i doing wrong?
Image:
I meant Artifacts..
quite complex and will take a while to grasp, so I decided to use your
simplified water scene node..
Very cool, but I get a strange offset in the reflected image and
some artifacts on the left side..
What am i doing wrong?
Image:
I meant Artifacts..
Re: Realistic water node
SOLVED..
In the "Water_ps.glsl" file:
and in the "Water_ps.hlsl" file:
In the "Water_ps.glsl" file:
Code: Select all
void main()
{// Bump Colour..
vec4 bumpColor = texture2D(WaterBump, bumpMapTexCoord);
// vec2 perturbation = WaveHeight * (bumpColor.rg - 0.5); // Old line..
vec2 perturbation = WaveHeight * (bumpColor.rg - 0.25); // 0.5 replaced by 0.25
// rest of code....
Code: Select all
PS_OUTPUT main( PS_INPUT input )
{
PS_OUTPUT output;
//bump color
float4 bumpColor = tex2D(WaterBump, input.bumpMapTexCoord);
// float2 perturbation = WaveHeight * (bumpColor.rg - 0.5); // Old line..
float2 perturbation = WaveHeight * (bumpColor.rg - 0.25); // 0.5 replaced by 0.25
Last edited by Vectrotek on Sat Jun 18, 2016 3:19 pm, edited 1 time in total.