Hello.
I’m using the reflective Water Prefab bundled with pro, but am unhappy with the render to texture resolution used for reflections. Is there a way to increase this to gain further detail on the reflective surface?
Hello.
I’m using the reflective Water Prefab bundled with pro, but am unhappy with the render to texture resolution used for reflections. Is there a way to increase this to gain further detail on the reflective surface?
Yes there is.
This is a 2-step process:
Select the render texture used in the water, go into expert settings and up the res.
Do an ‘Edit Shader’ on the Shader pulldown menu in the material editor. This will bring up the source code. Around line 79, you’ll see this block of code:
float4x4 mat= float4x4 (
128,0,0,128,// - _BumpPeturb / 4,
0,128,0,128,// - _BumpPeturb / 4,
0,0,.5,.5,
0,0,0,1
);
The 128s on the first line is HALF the width of the rendertex.
the 128s on the 2nd line is HALF the height of the rendertex.
Change these to be half the new size of the rendertex.
nice!. Here is a version with increased the resolution to 1024px:
http://www.zerofractal.com/fractalreality/white%20floor.html
To get rid of the waves I changed the bump for a 50% grey, removed the wave speed and the main texture.
Only one thing I dont like. Despite the color of the gradient or the cube, the reflections are incredeblybright.
Is there an easy way top apply a gradien to darken out the floor, or a way to make the rendered reflection not as bright or contrasted?
Thanks!
The strength of the reflection is controlled by the alpha channel of the color ramp.
IIRC, the left sidde of the ramp is when you’re looking straight down in the water - the right side is along horizon.
If you want water, the important effect is to get the reflections be darker as you look downwards, and stronger towards the horizon.
will give it a shot.
Fresnel…right?
Exactly… IIRC, I added some small bands towards the horizon… These should not really be there, but it brought the water more to life
How do you up the size of the reflection texture in the updated shader?
Select the rendertexture in project view (Pro Standard Assets/Water/Sources), switch to Debug inspector mode and change the size (default is 256x256). We’ll improve rendertexture inspector in the next release so that you don’t have to do that in Debug mode.