From 2ee815478043c4d5845f094f744a055707dba0e0 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 10 Aug 2011 13:01:14 -0500 Subject: SH-2238, SH-2223, SH-SH-2242 glVertexAttrib throughout main render pipeline complete, preview renders and debug displays still pending. Also fixed a render glitch and a crash (JIRAs listed). --- .../shaders/class1/objects/fullbrightNoColorV.glsl | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 indra/newview/app_settings/shaders/class1/objects/fullbrightNoColorV.glsl (limited to 'indra/newview/app_settings/shaders/class1/objects/fullbrightNoColorV.glsl') diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightNoColorV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightNoColorV.glsl new file mode 100644 index 0000000000..57d98038e0 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightNoColorV.glsl @@ -0,0 +1,27 @@ +/** + * @file fullbrightNoColorV.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $/LicenseInfo$ + */ + +attribute vec3 position; +attribute vec2 texcoord0; +attribute vec3 normal; + +void calcAtmospherics(vec3 inPositionEye); + +void main() +{ + //transform vertex + vec4 vert = vec4(position.xyz,1.0); + vec4 pos = (gl_ModelViewMatrix * vert); + gl_Position = gl_ModelViewProjectionMatrix*vec4(position.xyz, 1.0); + gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1); + + calcAtmospherics(pos.xyz); + + gl_FrontColor = vec4(1,1,1,1); + + gl_FogFragCoord = pos.z; +} -- cgit v1.2.3 From 530981a2149a74e1dc003cea1bbc9dc392fcae60 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 15 Sep 2011 00:54:25 -0500 Subject: SH-2243 work in progress -- no more deprecated built-in matrix state when using shaders. --- .../shaders/class1/objects/fullbrightNoColorV.glsl | 30 +++++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) (limited to 'indra/newview/app_settings/shaders/class1/objects/fullbrightNoColorV.glsl') diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightNoColorV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightNoColorV.glsl index 57d98038e0..b9c1078c30 100644 --- a/indra/newview/app_settings/shaders/class1/objects/fullbrightNoColorV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightNoColorV.glsl @@ -2,9 +2,31 @@ * @file fullbrightNoColorV.glsl * * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2007, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +uniform mat4 texture_matrix0; +uniform mat4 modelview_matrix; +uniform mat4 modelview_projection_matrix; + attribute vec3 position; attribute vec2 texcoord0; attribute vec3 normal; @@ -15,9 +37,9 @@ void main() { //transform vertex vec4 vert = vec4(position.xyz,1.0); - vec4 pos = (gl_ModelViewMatrix * vert); - gl_Position = gl_ModelViewProjectionMatrix*vec4(position.xyz, 1.0); - gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1); + vec4 pos = (modelview_matrix * vert); + gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); + gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1); calcAtmospherics(pos.xyz); -- cgit v1.2.3 From da84f5552731e1ece3a463c4c385bb327f1048a1 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 16 Sep 2011 12:40:53 -0500 Subject: SH-2243 work in progress -- don't use deprecated shader state --- .../shaders/class1/objects/fullbrightNoColorV.glsl | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'indra/newview/app_settings/shaders/class1/objects/fullbrightNoColorV.glsl') diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightNoColorV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightNoColorV.glsl index b9c1078c30..f73760bfd4 100644 --- a/indra/newview/app_settings/shaders/class1/objects/fullbrightNoColorV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightNoColorV.glsl @@ -27,9 +27,13 @@ uniform mat4 texture_matrix0; uniform mat4 modelview_matrix; uniform mat4 modelview_projection_matrix; -attribute vec3 position; -attribute vec2 texcoord0; -attribute vec3 normal; +ATTRIBUTE vec3 position; +ATTRIBUTE vec2 texcoord0; +ATTRIBUTE vec3 normal; + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; +VARYING float fog_depth; void calcAtmospherics(vec3 inPositionEye); @@ -39,11 +43,11 @@ void main() vec4 vert = vec4(position.xyz,1.0); vec4 pos = (modelview_matrix * vert); gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); - gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1); + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; calcAtmospherics(pos.xyz); - gl_FrontColor = vec4(1,1,1,1); + vertex_color = vec4(1,1,1,1); - gl_FogFragCoord = pos.z; + fog_depth = pos.z; } -- cgit v1.2.3 From 348a70181211b8fe37c569f8b3fb8324cc8c59ea Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 28 Sep 2011 00:41:10 -0500 Subject: SH-2507 Shave some unused/redundant varying state and make the max texture index debug setting rebuild shaders to use no flow control when set to 1 or lower --- .../app_settings/shaders/class1/objects/fullbrightNoColorV.glsl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/app_settings/shaders/class1/objects/fullbrightNoColorV.glsl') diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightNoColorV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightNoColorV.glsl index f73760bfd4..5d6f14230c 100644 --- a/indra/newview/app_settings/shaders/class1/objects/fullbrightNoColorV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightNoColorV.glsl @@ -33,7 +33,7 @@ ATTRIBUTE vec3 normal; VARYING vec4 vertex_color; VARYING vec2 vary_texcoord0; -VARYING float fog_depth; + void calcAtmospherics(vec3 inPositionEye); @@ -49,5 +49,5 @@ void main() vertex_color = vec4(1,1,1,1); - fog_depth = pos.z; + } -- cgit v1.2.3