Преглед на файлове

Added logarithmic depth buffer support

WestLangley преди 6 години
родител
ревизия
e782af8394
променени са 1 файла, в които са добавени 5 реда и са изтрити 0 реда
  1. 5 0
      examples/js/objects/Water2.js

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

@@ -237,6 +237,7 @@ THREE.Water.WaterShader = {
 	vertexShader: [
 	vertexShader: [
 
 
 		'#include <fog_pars_vertex>',
 		'#include <fog_pars_vertex>',
+		'#include <logdepthbuf_pars_vertex>',
 
 
 		'uniform mat4 textureMatrix;',
 		'uniform mat4 textureMatrix;',
 
 
@@ -255,6 +256,7 @@ THREE.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>',
 
 
 		'}'
 		'}'
@@ -265,6 +267,7 @@ THREE.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;',
@@ -287,6 +290,8 @@ THREE.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;',