diff options
author | Dave Parks <davep@lindenlab.com> | 2011-08-10 14:50:11 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2011-08-10 14:50:11 -0500 |
commit | 265db1f17c74c8e21a532e2e85a623383ef84728 (patch) | |
tree | 98d3771410e4b96af9009dd6566d1481d07e8bd2 /indra/newview/app_settings/shaders/class1/objects | |
parent | 17f46868d28876b65adcf24a45e6c19a20f2834c (diff) | |
parent | db92b0369194f1a81b92fd3fa72458eb0c1d2f20 (diff) |
merge
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/objects')
14 files changed, 231 insertions, 52 deletions
diff --git a/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl b/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl index 056d1a9582..438a9bec85 100644 --- a/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl @@ -6,11 +6,16 @@ */ +attribute vec3 position; +attribute vec4 diffuse_color; +attribute vec2 texcoord0; +attribute vec2 texcoord1; + void main() { //transform vertex - gl_Position = gl_ModelViewProjectionMatrix*gl_Vertex; - gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; - gl_TexCoord[1] = gl_TextureMatrix[1] * gl_MultiTexCoord1; - gl_FrontColor = gl_Color; + gl_Position = gl_ModelViewProjectionMatrix*vec4(position.xyz, 1.0); + gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1); + gl_TexCoord[1] = gl_TextureMatrix[1] * vec4(texcoord1,0,1); + gl_FrontColor = diffuse_color; } diff --git a/indra/newview/app_settings/shaders/class1/objects/emissiveSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/objects/emissiveSkinnedV.glsl new file mode 100644 index 0000000000..78668711ac --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/objects/emissiveSkinnedV.glsl @@ -0,0 +1,33 @@ +/** + * @file emissiveSkinnedV.glsl + * + * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc. + * $License$ + */ + + +attribute vec3 position; +attribute float emissive; +attribute vec2 texcoord0; + +void calcAtmospherics(vec3 inPositionEye); +mat4 getObjectSkinnedTransform(); + +void main() +{ + //transform vertex + gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1); + + mat4 mat = getObjectSkinnedTransform(); + + mat = gl_ModelViewMatrix * mat; + vec3 pos = (mat*vec4(position.xyz, 1.0)).xyz; + + calcAtmospherics(pos.xyz); + + gl_FrontColor = vec4(0,0,0,emissive); + + gl_Position = gl_ProjectionMatrix*vec4(pos, 1.0); + + gl_FogFragCoord = pos.z; +} diff --git a/indra/newview/app_settings/shaders/class1/objects/emissiveV.glsl b/indra/newview/app_settings/shaders/class1/objects/emissiveV.glsl new file mode 100644 index 0000000000..05d7cc397f --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/objects/emissiveV.glsl @@ -0,0 +1,29 @@ +/** + * @file emissiveV.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $/LicenseInfo$ + */ + +attribute vec4 position; +attribute float emissive; +attribute vec2 texcoord0; + +void calcAtmospherics(vec3 inPositionEye); + +varying float vary_texture_index; + +void main() +{ + //transform vertex + vary_texture_index = position.w; + gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0); + gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1); + + vec4 pos = (gl_ModelViewMatrix * vec4(position.xyz, 1.0)); + calcAtmospherics(pos.xyz); + + gl_FrontColor = vec4(0,0,0,emissive); + + gl_FogFragCoord = pos.z; +} 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; +} diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightShinySkinnedV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightShinySkinnedV.glsl index 5283e80407..5ed2b38f42 100644 --- a/indra/newview/app_settings/shaders/class1/objects/fullbrightShinySkinnedV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightShinySkinnedV.glsl @@ -6,6 +6,10 @@ */ +attribute vec3 position; +attribute vec3 normal; +attribute vec4 diffuse_color; +attribute vec2 texcoord0; void calcAtmospherics(vec3 inPositionEye); mat4 getObjectSkinnedTransform(); @@ -15,21 +19,21 @@ void main() mat4 mat = getObjectSkinnedTransform(); mat = gl_ModelViewMatrix * mat; - vec3 pos = (mat*gl_Vertex).xyz; + vec3 pos = (mat*vec4(position.xyz, 1.0)).xyz; - vec4 norm = gl_Vertex; - norm.xyz += gl_Normal.xyz; + vec4 norm = vec4(position.xyz, 1.0); + norm.xyz += normal.xyz; norm.xyz = (mat*norm).xyz; norm.xyz = normalize(norm.xyz-pos.xyz); vec3 ref = reflect(pos.xyz, -norm.xyz); - gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; + gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1); gl_TexCoord[1] = gl_TextureMatrix[1]*vec4(ref,1.0); calcAtmospherics(pos.xyz); - gl_FrontColor = gl_Color; + gl_FrontColor = diffuse_color; gl_Position = gl_ProjectionMatrix*vec4(pos, 1.0); diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyV.glsl index 31e0f0a429..4063294c51 100644 --- a/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyV.glsl @@ -6,6 +6,10 @@ */ +attribute vec3 position; +attribute vec4 diffuse_color; +attribute vec3 normal; +attribute vec2 texcoord0; void calcAtmospherics(vec3 inPositionEye); @@ -14,18 +18,18 @@ uniform vec4 origin; void main() { //transform vertex - gl_Position = ftransform(); + gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0); - vec4 pos = (gl_ModelViewMatrix * gl_Vertex); - vec3 norm = normalize(gl_NormalMatrix * gl_Normal); + vec3 norm = normalize(gl_NormalMatrix * normal); vec3 ref = reflect(pos.xyz, -norm); - gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; + gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1); gl_TexCoord[1] = gl_TextureMatrix[1]*vec4(ref,1.0); + vec4 pos = (gl_ModelViewMatrix * vec4(position.xyz, 1.0)); calcAtmospherics(pos.xyz); - gl_FrontColor = gl_Color; + gl_FrontColor = diffuse_color; gl_FogFragCoord = pos.z; } diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightSkinnedV.glsl index 1db79791de..316c93c36a 100644 --- a/indra/newview/app_settings/shaders/class1/objects/fullbrightSkinnedV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightSkinnedV.glsl @@ -6,6 +6,9 @@ */ +attribute vec3 position; +attribute vec4 diffuse_color; +attribute vec2 texcoord0; void calcAtmospherics(vec3 inPositionEye); mat4 getObjectSkinnedTransform(); @@ -13,21 +16,16 @@ mat4 getObjectSkinnedTransform(); void main() { //transform vertex - gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; + gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1); mat4 mat = getObjectSkinnedTransform(); mat = gl_ModelViewMatrix * mat; - vec3 pos = (mat*gl_Vertex).xyz; + vec3 pos = (mat*vec4(position.xyz, 1.0)).xyz; - vec4 norm = gl_Vertex; - norm.xyz += gl_Normal.xyz; - norm.xyz = (mat*norm).xyz; - norm.xyz = normalize(norm.xyz-pos.xyz); - calcAtmospherics(pos.xyz); - gl_FrontColor = gl_Color; + gl_FrontColor = diffuse_color; gl_Position = gl_ProjectionMatrix*vec4(pos, 1.0); diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightV.glsl index 3382384c99..d88612765c 100644 --- a/indra/newview/app_settings/shaders/class1/objects/fullbrightV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightV.glsl @@ -5,21 +5,24 @@ * $/LicenseInfo$ */ - +attribute vec3 position; +attribute vec4 diffuse_color; +attribute vec2 texcoord0; void calcAtmospherics(vec3 inPositionEye); void main() { //transform vertex - gl_Position = ftransform(); - gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; + vec4 pos = (gl_ModelViewMatrix * vec4(position.xyz, 1.0)); + gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0); + gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1); - vec4 pos = (gl_ModelViewMatrix * gl_Vertex); + calcAtmospherics(pos.xyz); - gl_FrontColor = gl_Color; + gl_FrontColor = diffuse_color; gl_FogFragCoord = pos.z; } diff --git a/indra/newview/app_settings/shaders/class1/objects/shinySimpleSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/objects/shinySimpleSkinnedV.glsl index eea41bb4f0..41a9cd2fe6 100644 --- a/indra/newview/app_settings/shaders/class1/objects/shinySimpleSkinnedV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/shinySimpleSkinnedV.glsl @@ -5,7 +5,10 @@ * $License$ */ - +attribute vec3 position; +attribute vec3 normal; +attribute vec4 diffuse_color; +attribute vec2 texcoord0; vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); void calcAtmospherics(vec3 inPositionEye); @@ -16,21 +19,21 @@ void main() mat4 mat = getObjectSkinnedTransform(); mat = gl_ModelViewMatrix * mat; - vec3 pos = (mat*gl_Vertex).xyz; + vec3 pos = (mat*vec4(position.xyz, 1.0)).xyz; - vec4 norm = gl_Vertex; - norm.xyz += gl_Normal.xyz; + vec4 norm = vec4(position.xyz, 1.0); + norm.xyz += normal.xyz; norm.xyz = (mat*norm).xyz; norm.xyz = normalize(norm.xyz-pos.xyz); vec3 ref = reflect(pos.xyz, -norm.xyz); - gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; + gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1); gl_TexCoord[1] = gl_TextureMatrix[1]*vec4(ref,1.0); calcAtmospherics(pos.xyz); - vec4 color = calcLighting(pos.xyz, norm.xyz, gl_Color, vec4(0.)); + vec4 color = calcLighting(pos.xyz, norm.xyz, diffuse_color, vec4(0.)); gl_FrontColor = color; gl_Position = gl_ProjectionMatrix*vec4(pos, 1.0); diff --git a/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl b/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl index 68a086dbc1..4757295470 100644 --- a/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl @@ -5,7 +5,10 @@ * $/LicenseInfo$ */ - +attribute vec3 position; +attribute vec3 normal; +attribute vec4 diffuse_color; +attribute vec2 texcoord0; void calcAtmospherics(vec3 inPositionEye); @@ -14,14 +17,14 @@ uniform vec4 origin; void main() { //transform vertex - gl_Position = ftransform(); + vec4 pos = (gl_ModelViewMatrix * vec4(position.xyz, 1.0)); + gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0); - vec4 pos = (gl_ModelViewMatrix * gl_Vertex); - vec3 norm = normalize(gl_NormalMatrix * gl_Normal); + vec3 norm = normalize(gl_NormalMatrix * normal); calcAtmospherics(pos.xyz); - gl_FrontColor = gl_Color; + gl_FrontColor = diffuse_color; vec3 ref = reflect(pos.xyz, -norm); diff --git a/indra/newview/app_settings/shaders/class1/objects/simpleNoColorV.glsl b/indra/newview/app_settings/shaders/class1/objects/simpleNoColorV.glsl new file mode 100644 index 0000000000..54c262885e --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/objects/simpleNoColorV.glsl @@ -0,0 +1,30 @@ +/** + * @file simpleNoColorV.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $/LicenseInfo$ + */ + +attribute vec3 position; +attribute vec3 normal; +attribute vec2 texcoord0; + +vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); +void calcAtmospherics(vec3 inPositionEye); + +void main() +{ + //transform vertex + vec4 pos = (gl_ModelViewMatrix * vec4(position.xyz, 1.0)); + gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0); + gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1); + + vec3 norm = normalize(gl_NormalMatrix * normal); + + calcAtmospherics(pos.xyz); + + vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), vec4(0.)); + gl_FrontColor = color; + + gl_FogFragCoord = pos.z; +} diff --git a/indra/newview/app_settings/shaders/class1/objects/simpleSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/objects/simpleSkinnedV.glsl index af92e5e002..fbda2e70d2 100644 --- a/indra/newview/app_settings/shaders/class1/objects/simpleSkinnedV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/simpleSkinnedV.glsl @@ -5,7 +5,10 @@ * $License$ */ - +attribute vec3 position; +attribute vec3 normal; +attribute vec4 diffuse_color; +attribute vec2 texcoord0; vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); void calcAtmospherics(vec3 inPositionEye); @@ -14,21 +17,21 @@ mat4 getObjectSkinnedTransform(); void main() { //transform vertex - gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; + gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1); mat4 mat = getObjectSkinnedTransform(); mat = gl_ModelViewMatrix * mat; - vec3 pos = (mat*gl_Vertex).xyz; + vec3 pos = (mat*vec4(position.xyz, 1.0)).xyz; - vec4 norm = gl_Vertex; - norm.xyz += gl_Normal.xyz; + vec4 norm = vec4(position.xyz, 1.0); + norm.xyz += normal.xyz; norm.xyz = (mat*norm).xyz; norm.xyz = normalize(norm.xyz-pos.xyz); calcAtmospherics(pos.xyz); - vec4 color = calcLighting(pos.xyz, norm.xyz, gl_Color, vec4(0.)); + vec4 color = calcLighting(pos.xyz, norm.xyz, diffuse_color, vec4(0.)); gl_FrontColor = color; gl_Position = gl_ProjectionMatrix*vec4(pos, 1.0); diff --git a/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl b/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl index b493f76fcc..39fad42acb 100644 --- a/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl @@ -5,7 +5,10 @@ * $/LicenseInfo$ */ - +attribute vec3 position; +attribute vec3 normal; +attribute vec4 diffuse_color; +attribute vec2 texcoord0; vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); void calcAtmospherics(vec3 inPositionEye); @@ -13,16 +16,15 @@ void calcAtmospherics(vec3 inPositionEye); void main() { //transform vertex - gl_Position = ftransform(); - gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; - - vec4 pos = (gl_ModelViewMatrix * gl_Vertex); - - vec3 norm = normalize(gl_NormalMatrix * gl_Normal); + vec4 pos = (gl_ModelViewMatrix * vec4(position.xyz, 1.0)); + gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0); + gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1); + + vec3 norm = normalize(gl_NormalMatrix * normal); calcAtmospherics(pos.xyz); - vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.)); + vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.)); gl_FrontColor = color; gl_FogFragCoord = pos.z; diff --git a/indra/newview/app_settings/shaders/class1/objects/treeV.glsl b/indra/newview/app_settings/shaders/class1/objects/treeV.glsl new file mode 100644 index 0000000000..1e9e7f4b0b --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/objects/treeV.glsl @@ -0,0 +1,35 @@ +/** + * @file treeV.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $/LicenseInfo$ + */ + + + +attribute vec3 position; +attribute vec2 texcoord0; +attribute vec3 normal; + +vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); +void calcAtmospherics(vec3 inPositionEye); + +void main() +{ + //transform vertex + vec4 vert = vec4(position.xyz,1.0); + + gl_Position = gl_ModelViewProjectionMatrix*vert; + gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0, 0, 1); + + vec4 pos = (gl_ModelViewMatrix * vert); + + vec3 norm = normalize(gl_NormalMatrix * normal); + + calcAtmospherics(pos.xyz); + + vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), vec4(0.)); + gl_FrontColor = color; + + gl_FogFragCoord = pos.z; +} |