Explorar el Código

Merge pull request #17014 from WestLangley/dev_water2_logdepth

Water2: Added logarithmic depth buffer support
Mr.doob hace 6 años
padre
commit
d6ffa4d4ae
Se han modificado 1 ficheros con 5 adiciones y 0 borrados
  1. 5 0
      examples/jsm/objects/Water2.js

+ 5 - 0
examples/jsm/objects/Water2.js

@@ -253,6 +253,7 @@ Water.WaterShader = {
 	vertexShader: [
 	vertexShader: [
 
 
 		'#include <fog_pars_vertex>',
 		'#include <fog_pars_vertex>',
+		'#include <logdepthbuf_pars_vertex>',
 
 
 		'uniform mat4 textureMatrix;',
 		'uniform mat4 textureMatrix;',
 
 
@@ -271,6 +272,7 @@ Water.WaterShader = {
 		'	vec4 mvPosition =  viewMatrix * worldPosition;', // used in fog_vertex
 		'	vec4 mvPosition =  viewMatrix * worldPosition;', // used in fog_vertex
 		'	gl_Position = projectionMatrix * mvPosition;',
 		'	gl_Position = projectionMatrix * mvPosition;',
 
 
+		'	#include <logdepthbuf_vertex>',
 		'	#include <fog_vertex>',
 		'	#include <fog_vertex>',
 
 
 		'}'
 		'}'
@@ -281,6 +283,7 @@ Water.WaterShader = {
 
 
 		'#include <common>',
 		'#include <common>',
 		'#include <fog_pars_fragment>',
 		'#include <fog_pars_fragment>',
+		'#include <logdepthbuf_pars_fragment>',
 
 
 		'uniform sampler2D tReflectionMap;',
 		'uniform sampler2D tReflectionMap;',
 		'uniform sampler2D tRefractionMap;',
 		'uniform sampler2D tRefractionMap;',
@@ -303,6 +306,8 @@ Water.WaterShader = {
 
 
 		'void main() {',
 		'void main() {',
 
 
+		'	#include <logdepthbuf_fragment>',
+
 		'	float flowMapOffset0 = config.x;',
 		'	float flowMapOffset0 = config.x;',
 		'	float flowMapOffset1 = config.y;',
 		'	float flowMapOffset1 = config.y;',
 		'	float halfCycle = config.z;',
 		'	float halfCycle = config.z;',