From 6e184e33018a5395bfbb2c92812229d115944ab5 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 2 Apr 2012 17:55:04 -0500 Subject: Cleaner render of walkables and materials. Convert Vector3 color parameters to Color4. --- .../shaders/class1/interface/pathfindingF.glsl | 35 +++++++++++++++++++ .../shaders/class1/interface/pathfindingV.glsl | 40 ++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 indra/newview/app_settings/shaders/class1/interface/pathfindingF.glsl create mode 100644 indra/newview/app_settings/shaders/class1/interface/pathfindingV.glsl (limited to 'indra/newview/app_settings/shaders') diff --git a/indra/newview/app_settings/shaders/class1/interface/pathfindingF.glsl b/indra/newview/app_settings/shaders/class1/interface/pathfindingF.glsl new file mode 100644 index 0000000000..40605bee78 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/interface/pathfindingF.glsl @@ -0,0 +1,35 @@ +/** + * @file pathfindingF.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$ + */ + +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 gl_FragColor; +#endif + +VARYING vec4 vertex_color; + +void main() +{ + gl_FragColor = vertex_color; +} diff --git a/indra/newview/app_settings/shaders/class1/interface/pathfindingV.glsl b/indra/newview/app_settings/shaders/class1/interface/pathfindingV.glsl new file mode 100644 index 0000000000..dc9fefd156 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/interface/pathfindingV.glsl @@ -0,0 +1,40 @@ +/** + * @file pathfindingV.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 modelview_projection_matrix; + +ATTRIBUTE vec3 position; +ATTRIBUTE vec4 diffuse_color; + +VARYING vec4 vertex_color; + +uniform float tint; + +void main() +{ + gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); + vertex_color = diffuse_color * tint; +} + -- cgit v1.2.3 From 817f1629bdafd6c28efa2a868a7aad75eb8a9514 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 3 Apr 2012 02:52:34 -0500 Subject: Pathfinding visualization WIP -- add many controls for x-ray render, add lighting, and better combat z-fighting and noise from wireframes and overlays --- .../shaders/class1/interface/pathfindingV.glsl | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'indra/newview/app_settings/shaders') diff --git a/indra/newview/app_settings/shaders/class1/interface/pathfindingV.glsl b/indra/newview/app_settings/shaders/class1/interface/pathfindingV.glsl index dc9fefd156..31e878ebc6 100644 --- a/indra/newview/app_settings/shaders/class1/interface/pathfindingV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/pathfindingV.glsl @@ -27,14 +27,28 @@ uniform mat4 modelview_projection_matrix; ATTRIBUTE vec3 position; ATTRIBUTE vec4 diffuse_color; +ATTRIBUTE vec3 normal; VARYING vec4 vertex_color; uniform float tint; - +uniform float ambiance; +uniform float alpha_scale; + void main() { gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); - vertex_color = diffuse_color * tint; + + vec3 l1 = vec3(-0.75, 1, 1.0); + vec3 l2 = vec3(0.5, -0.6, 0.4)*0.25; + vec3 l3 = vec3(0.5, -0.8, 0.3)*0.5; + + float lit = max(dot(normal, l1), 0.0); + lit += max(dot(normal, l2), 0.0); + lit += max(dot(normal, l3), 0.0); + + lit = clamp(lit, ambiance, 1.0); + + vertex_color = vec4(diffuse_color.rgb * tint * lit, diffuse_color.a*alpha_scale); } -- cgit v1.2.3 From 382c4bdfeb8350aeea1363b4ca8e01bf233a08be Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 4 Apr 2012 00:01:02 -0500 Subject: Better contrast between shapes and their outlines. --- indra/newview/app_settings/shaders/class1/interface/pathfindingV.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/app_settings/shaders') diff --git a/indra/newview/app_settings/shaders/class1/interface/pathfindingV.glsl b/indra/newview/app_settings/shaders/class1/interface/pathfindingV.glsl index 31e878ebc6..91f252cf1e 100644 --- a/indra/newview/app_settings/shaders/class1/interface/pathfindingV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/pathfindingV.glsl @@ -39,7 +39,7 @@ void main() { gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); - vec3 l1 = vec3(-0.75, 1, 1.0); + vec3 l1 = vec3(-0.75, 1, 1.0)*0.5; vec3 l2 = vec3(0.5, -0.6, 0.4)*0.25; vec3 l3 = vec3(0.5, -0.8, 0.3)*0.5; -- cgit v1.2.3 From 0f22e20bcef5e4344394e4cda1f8bafd52dc5dd2 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 4 Apr 2012 15:48:43 -0500 Subject: Add pathfindingNoNormal shader. --- .../class1/interface/pathfindingNoNormalV.glsl | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 indra/newview/app_settings/shaders/class1/interface/pathfindingNoNormalV.glsl (limited to 'indra/newview/app_settings/shaders') diff --git a/indra/newview/app_settings/shaders/class1/interface/pathfindingNoNormalV.glsl b/indra/newview/app_settings/shaders/class1/interface/pathfindingNoNormalV.glsl new file mode 100644 index 0000000000..19fa607307 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/interface/pathfindingNoNormalV.glsl @@ -0,0 +1,42 @@ +/** + * @file pathfindingV.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 modelview_projection_matrix; + +ATTRIBUTE vec3 position; +ATTRIBUTE vec4 diffuse_color; + +VARYING vec4 vertex_color; + +uniform float tint; +uniform float alpha_scale; + +void main() +{ + gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); + + vertex_color = vec4(diffuse_color.rgb * tint, diffuse_color.a*alpha_scale); +} + -- cgit v1.2.3 From 997b360747bb21564f0ef89c3b3e065ea3ec0716 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 11 Jul 2012 15:17:13 -0500 Subject: MAINT-794 Fix for assert on loading some types of objects before their parents. --- .../newview/app_settings/shaders/class1/objects/indexedTextureV.glsl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/app_settings/shaders') diff --git a/indra/newview/app_settings/shaders/class1/objects/indexedTextureV.glsl b/indra/newview/app_settings/shaders/class1/objects/indexedTextureV.glsl index 7c0699d72f..ca29bf3143 100644 --- a/indra/newview/app_settings/shaders/class1/objects/indexedTextureV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/indexedTextureV.glsl @@ -23,9 +23,9 @@ * $/LicenseInfo$ */ -ATTRIBUTE ivec4 texture_index; +ATTRIBUTE int texture_index; -VARYING_FLAT ivec4 vary_texture_index; +VARYING_FLAT int vary_texture_index; void passTextureIndex() { -- cgit v1.2.3 From 02a182867c4a760e535ad87d21465ffc1499aa25 Mon Sep 17 00:00:00 2001 From: prep Date: Mon, 16 Jul 2012 15:11:23 -0400 Subject: Path-814: Corrected shader fragment compilation error. --- .../newview/app_settings/shaders/class1/interface/pathfindingF.glsl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'indra/newview/app_settings/shaders') diff --git a/indra/newview/app_settings/shaders/class1/interface/pathfindingF.glsl b/indra/newview/app_settings/shaders/class1/interface/pathfindingF.glsl index 40605bee78..7379360e17 100644 --- a/indra/newview/app_settings/shaders/class1/interface/pathfindingF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/pathfindingF.glsl @@ -24,12 +24,14 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor #endif VARYING vec4 vertex_color; void main() { - gl_FragColor = vertex_color; + frag_color = vertex_color; } -- cgit v1.2.3