Open the Shader Graph:
- Double-click the
OceanShaderto open the Shader Graph editor.
Base Color Setup:
- Color Node: Create a
Colornode and set it to a blue-green color to represent the ocean. - Multiply Node (Base Color): Create a
Multiplynode and connect theColornode to its input.
Wave Texture:
- Simple Noise Node: Create a
Simple Noisenode. - Tiling and Offset Node: Create a
Tiling and Offsetnode and connect theSimple Noisenode to it. - Multiply Node (Wave Texture): Create another
Multiplynode and connect theTiling and Offsetnode to it.
Wave Animation:
- Time Node: Create a
Timenode. - Multiply Node (Speed): Create a
Multiplynode, connect theTimenode to one input, and create aVector1node namedSpeedto the other input. - Sine Node: Create a
Sinenode and connect theMultiply (Speed)node to it. - Add Node (UV Coordinates): Create an
Addnode, connect theSinenode to it, and add UV coordinates as the other input.
Normal Mapping:
- Simple Noise Node (Height): Create another
Simple Noisenode for height. - Multiply Node (Normal): Create a
Multiplynode and connect theSimple Noise (Height)node to it. - Normal From Height Node: Create a
Normal From Heightnode and connect theMultiply (Normal)node to it. - Normal Vector Node: Create a
Normal Vectornode and connect theNormal From Heightnode to it. - PBR Master (Normal): Connect the
Normal Vectornode to theNormalinput of thePBR Masternode.
Reflection Setup:
- Reflection Probe Node: Create a
Reflection Probenode. - Multiply Node (Intensity): Create a
Multiplynode and connect theReflection Probenode to it. Create aVector1node namedIntensityand connect it to the other input. - Add Node (Base Color Composition): Create an
Addnode, connect theMultiply (Intensity)node to one input, and connect theMultiply (Base Color)node to the other input.
Refraction Setup:
- Screen Position Node: Create a
Screen Positionnode. - Add Node (Distortion): Create an
Addnode, connect theScreen Positionnode to one input, and add distortion as the other input. - Sample Texture 2D Node (Screen Texture): Create a
Sample Texture 2Dnode, connect theAdd (Distortion)node to its UV input. - PBR Master (Refraction): Connect the
Sample Texture 2Dnode to theRefractioninput of thePBR Masternode.
Finalizing the Shader:
- PBR Master (Base Color): Connect the
Add (Base Color Composition)node to theBase Colorinput of thePBR Masternode.