Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
water [2020/01/10 09:33] – [Example] adminwater [2020/06/02 14:52] – [Example] admin
Line 54: Line 54:
 ==== Water Material ==== ==== Water Material ====
  
-Finally of course we need a material shader (TGorillaWaterMaterialSource), which is able to merge all components together.+Finally of course we need a material shader (TGorillaWaterMaterialSource), which is able to merge all components together. The material source is inherited from the TGorillaDefaultMaterialSource and supports multiple light sources and the different shading models.
  
 For computing waves, riffles and foam the shader needs a few textures: For computing waves, riffles and foam the shader needs a few textures:
Line 96: Line 96:
 | WaveSize | Defines the amplitude of waves, which means how high or low waves are simulated. This value do not manipulate mesh vertices (only by displacement mapping). | | WaveSize | Defines the amplitude of waves, which means how high or low waves are simulated. This value do not manipulate mesh vertices (only by displacement mapping). |
 | Displacement | Defines the factor of vertex displacement based on the displacement map or normal map. | | Displacement | Defines the factor of vertex displacement based on the displacement map or normal map. |
 +| ReflCorrection | By this value you can modify the color of reflection, default value: Vector3D(1.0, 1.0, 1.0, 1.0) |
 +| RefrCorrection | By this value you can modify the color of refraction on water surface, default value: Vector3D(1.1, 1.1, 1.1, 1.0) |
  
 ===== Example ===== ===== Example =====
 +
 +{{youtube>HGlyOlVD28I?medium}}
  
 Take a look at this example code for a complex water surface setup. Take a look at this example code for a complex water surface setup.
Line 146: Line 150:
   FWaterMaterial := TGorillaWaterMaterialSource.Create(FWaterPlane);   FWaterMaterial := TGorillaWaterMaterialSource.Create(FWaterPlane);
   FWaterMaterial.Parent := FWaterPlane;   FWaterMaterial.Parent := FWaterPlane;
-  FWaterMaterial.NormalTexture.LoadFromFile(LTexPath + 'water_normal.png');+  FWaterMaterial.NormalMap.LoadFromFile(LTexPath + 'water_normal.png');
   FWaterMaterial.DUDVTexture.LoadFromFile(LTexPath + 'water3-dudv.jpg');   FWaterMaterial.DUDVTexture.LoadFromFile(LTexPath + 'water3-dudv.jpg');
-  FWaterMaterial.DisplacementTexture.LoadFromFile(LTexPath + 'water_height.png'); +  FWaterMaterial.DisplacementMap.LoadFromFile(LTexPath + 'water_height.png'); 
-  FWaterMaterial.SpecularTexture.LoadFromFile(LTexPath + 'water_height.png');+  FWaterMaterial.SpecularMap.LoadFromFile(LTexPath + 'water_height.png');
   FWaterMaterial.FoamTexture.LoadFromFile(LTexPath + 'foam.png');   FWaterMaterial.FoamTexture.LoadFromFile(LTexPath + 'foam.png');