Răsfoiți Sursa

SobelOperatorShader: Format

Mugen87 8 ani în urmă
părinte
comite
380f28cf99
1 a modificat fișierele cu 7 adăugiri și 7 ștergeri
  1. 7 7
      examples/js/shaders/SobelOperatorShader.js

+ 7 - 7
examples/js/shaders/SobelOperatorShader.js

@@ -36,7 +36,7 @@ THREE.SobelOperatorShader = {
 			// kernel definition (in glsl matrices are filled in column-major order)
 			// kernel definition (in glsl matrices are filled in column-major order)
 
 
 			"const mat3 Gx = mat3( -1, -2, -1, 0, 0, 0, 1, 2, 1 );", // x direction kernel
 			"const mat3 Gx = mat3( -1, -2, -1, 0, 0, 0, 1, 2, 1 );", // x direction kernel
-      "const mat3 Gy = mat3( -1, 0, 1, -2, 0, 2, -1, 0, 1 );", // y direction kernel
+			"const mat3 Gy = mat3( -1, 0, 1, -2, 0, 2, -1, 0, 1 );", // y direction kernel
 
 
 			// fetch the 3x3 neighbourhood of a fragment
 			// fetch the 3x3 neighbourhood of a fragment
 
 
@@ -76,15 +76,15 @@ THREE.SobelOperatorShader = {
 
 
 			// gradient value in x direction
 			// gradient value in x direction
 
 
-			"float valueGx = 	Gx[0][0] * tx0y0 + Gx[1][0] * tx1y0 + Gx[2][0] * tx2y0 + ",
-			"									Gx[0][1] * tx0y1 + Gx[1][1] * tx1y1 + Gx[2][1] * tx2y1 + ",
-			"									Gx[0][2] * tx0y2 + Gx[1][2] * tx1y2 + Gx[2][2] * tx2y2; ",
+			"float valueGx = Gx[0][0] * tx0y0 + Gx[1][0] * tx1y0 + Gx[2][0] * tx2y0 + ",
+				"Gx[0][1] * tx0y1 + Gx[1][1] * tx1y1 + Gx[2][1] * tx2y1 + ",
+				"Gx[0][2] * tx0y2 + Gx[1][2] * tx1y2 + Gx[2][2] * tx2y2; ",
 
 
 			// gradient value in y direction
 			// gradient value in y direction
 
 
-			"float valueGy = 	Gy[0][0] * tx0y0 + Gy[1][0] * tx1y0 + Gy[2][0] * tx2y0 + ",
-			"									Gy[0][1] * tx0y1 + Gy[1][1] * tx1y1 + Gy[2][1] * tx2y1 + ",
-			"									Gy[0][2] * tx0y2 + Gy[1][2] * tx1y2 + Gy[2][2] * tx2y2; ",
+			"float valueGy = Gy[0][0] * tx0y0 + Gy[1][0] * tx1y0 + Gy[2][0] * tx2y0 + ",
+				"Gy[0][1] * tx0y1 + Gy[1][1] * tx1y1 + Gy[2][1] * tx2y1 + ",
+				"Gy[0][2] * tx0y2 + Gy[1][2] * tx1y2 + Gy[2][2] * tx2y2; ",
 
 
 			// magnitute of the total gradient
 			// magnitute of the total gradient