[Bf-blender-cvs] [5f701160307] blender2.8: OpenGL: Fix textureXd deprecated calls.

Clément Foucault noreply at git.blender.org
Mon Apr 10 16:59:31 CEST 2017


Commit: 5f7011603077511425febf2a7397b2cc7bba1720
Author: Clément Foucault
Date:   Mon Apr 10 16:58:08 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB5f7011603077511425febf2a7397b2cc7bba1720

OpenGL: Fix textureXd deprecated calls.

===================================================================

M	source/blender/draw/engines/clay/shaders/ssao_alchemy.glsl
M	source/blender/draw/engines/clay/shaders/ssao_groundtruth.glsl
M	source/blender/gpu/shaders/gpu_shader_fx_depth_resolve.glsl
M	source/blender/gpu/shaders/gpu_shader_fx_dof_frag.glsl
M	source/blender/gpu/shaders/gpu_shader_fx_dof_hq_frag.glsl
M	source/blender/gpu/shaders/gpu_shader_fx_ssao_frag.glsl

===================================================================

diff --git a/source/blender/draw/engines/clay/shaders/ssao_alchemy.glsl b/source/blender/draw/engines/clay/shaders/ssao_alchemy.glsl
index d032fb91c01..20903b5c871 100644
--- a/source/blender/draw/engines/clay/shaders/ssao_alchemy.glsl
+++ b/source/blender/draw/engines/clay/shaders/ssao_alchemy.glsl
@@ -9,7 +9,7 @@
 void ssao_factors(in float depth, in vec3 normal, in vec3 position, in vec2 screenco, out float cavities, out float edges)
 {
 	/* take the normalized ray direction here */
-	vec2 rotX = texture2D(ssao_jitter, screenco.xy * jitter_tilling).rg;
+	vec2 rotX = texture(ssao_jitter, screenco.xy * jitter_tilling).rg;
 	vec2 rotY = vec2(-rotX.y, rotX.x);
 
 	/* find the offset in screen space by multiplying a point
@@ -27,7 +27,7 @@ void ssao_factors(in float depth, in vec3 normal, in vec3 position, in vec2 scre
 
 	for (x = 0; x < num_samples; x++) {
 		/* TODO : optimisation replace by constant */
-		vec2 dir_sample = texture1D(ssao_samples, (float(x) + 0.5) / ssao_samples_num).rg;
+		vec2 dir_sample = texture(ssao_samples, (float(x) + 0.5) / ssao_samples_num).rg;
 
 		/* rotate with random direction to get jittered result */
 		vec2 dir_jittered = vec2(dot(dir_sample, rotX), dot(dir_sample, rotY));
@@ -37,7 +37,7 @@ void ssao_factors(in float depth, in vec3 normal, in vec3 position, in vec2 scre
 		if (uvcoords.x > 1.0 || uvcoords.x < 0.0 || uvcoords.y > 1.0 || uvcoords.y < 0.0)
 			continue;
 
-		float depth_new = texture2D(depthtex, uvcoords).r;
+		float depth_new = texture(depthtex, uvcoords).r;
 
 		/* Handle Background case */
 		bool is_background = (depth_new == 1.0);
diff --git a/source/blender/draw/engines/clay/shaders/ssao_groundtruth.glsl b/source/blender/draw/engines/clay/shaders/ssao_groundtruth.glsl
index 2f29624824e..2d7dbbb3e17 100644
--- a/source/blender/draw/engines/clay/shaders/ssao_groundtruth.glsl
+++ b/source/blender/draw/engines/clay/shaders/ssao_groundtruth.glsl
@@ -32,7 +32,7 @@ float get_max_horizon(in vec2 co, in vec3 x, in vec3 omega_o, in float h)
 	if (co.x > 1.0 || co.x < 0.0 || co.y > 1.0 || co.y < 0.0)
 		return h;
 
-	float depth = texture2D(depthtex, co).r;
+	float depth = texture(depthtex, co).r;
 
 	/* Background case */
 	if (depth == 1.0)
diff --git a/source/blender/gpu/shaders/gpu_shader_fx_depth_resolve.glsl b/source/blender/gpu/shaders/gpu_shader_fx_depth_resolve.glsl
index 3ba455d34e7..468908b858c 100644
--- a/source/blender/gpu/shaders/gpu_shader_fx_depth_resolve.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_fx_depth_resolve.glsl
@@ -4,6 +4,7 @@ uniform sampler2D depthbuffer;
 	varying vec4 uvcoordsvar;
 #else
 	in vec4 uvcoordsvar;
+	#define texture2D texture
 #endif
 
 void main(void)
diff --git a/source/blender/gpu/shaders/gpu_shader_fx_dof_frag.glsl b/source/blender/gpu/shaders/gpu_shader_fx_dof_frag.glsl
index 6b3f1b99594..02af48e1ba7 100644
--- a/source/blender/gpu/shaders/gpu_shader_fx_dof_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_fx_dof_frag.glsl
@@ -44,6 +44,7 @@ uniform vec4 viewvecs[3];
 	in vec2 depth_uv4;
 
 	out vec4 FragColor;
+	#define texture2D texture
 #endif
 
 
diff --git a/source/blender/gpu/shaders/gpu_shader_fx_dof_hq_frag.glsl b/source/blender/gpu/shaders/gpu_shader_fx_dof_hq_frag.glsl
index 46feb91de6e..6ed9812eeec 100644
--- a/source/blender/gpu/shaders/gpu_shader_fx_dof_hq_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_fx_dof_hq_frag.glsl
@@ -54,6 +54,8 @@ uniform vec4 viewvecs[3];
 	layout(location = 0) out vec4 fragData0;
 	layout(location = 1) out vec4 fragData1;
 	layout(location = 2) out vec4 fragData2;
+
+	#define texture2D texture
 #endif
 
 
diff --git a/source/blender/gpu/shaders/gpu_shader_fx_ssao_frag.glsl b/source/blender/gpu/shaders/gpu_shader_fx_ssao_frag.glsl
index 4a6cc09f5ea..529132f85a9 100644
--- a/source/blender/gpu/shaders/gpu_shader_fx_ssao_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_fx_ssao_frag.glsl
@@ -18,6 +18,8 @@ uniform sampler2D depthbuffer;
 #else
 	in vec4 uvcoordsvar;
 	out vec4 FragColor;
+	#define texture1D texture
+	#define texture2D texture
 #endif
 
 /* ssao_params.x : pixel scale for the ssao radious */




More information about the Bf-blender-cvs mailing list