Skip to content
Snippets Groups Projects
Commit 21b1b91c authored by David Parks's avatar David Parks
Browse files

ATI compatibility pass

parent 478e0927
No related branches found
No related tags found
No related merge requests found
Showing
with 64 additions and 5 deletions
...@@ -704,6 +704,7 @@ void LLGLSLShader::uniformMatrix4fv(U32 index, U32 count, GLboolean transpose, c ...@@ -704,6 +704,7 @@ void LLGLSLShader::uniformMatrix4fv(U32 index, U32 count, GLboolean transpose, c
GLint LLGLSLShader::getUniformLocation(const string& uniform) GLint LLGLSLShader::getUniformLocation(const string& uniform)
{ {
GLint ret = -1;
if (mProgramObject > 0) if (mProgramObject > 0)
{ {
std::map<string, GLint>::iterator iter = mUniformMap.find(uniform); std::map<string, GLint>::iterator iter = mUniformMap.find(uniform);
...@@ -718,11 +719,19 @@ GLint LLGLSLShader::getUniformLocation(const string& uniform) ...@@ -718,11 +719,19 @@ GLint LLGLSLShader::getUniformLocation(const string& uniform)
} }
stop_glerror(); stop_glerror();
} }
return iter->second; ret = iter->second;
} }
} }
return -1; if (gDebugGL)
{
if (ret == -1 && ret != glGetUniformLocationARB(mProgramObject, uniform.c_str()))
{
llerrs << "Uniform map invalid." << llendl;
}
}
return ret;
} }
GLint LLGLSLShader::getAttribLocation(U32 attrib) GLint LLGLSLShader::getAttribLocation(U32 attrib)
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
* $LicenseInfo:firstyear=2007&license=viewerlgpl$ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
* $/LicenseInfo$ * $/LicenseInfo$
*/ */
#version 120
void default_lighting(); void default_lighting();
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
* $LicenseInfo:firstyear=2007&license=viewerlgpl$ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
* $/LicenseInfo$ * $/LicenseInfo$
*/ */
#version 120
attribute vec4 weight; //1 attribute vec4 weight; //1
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
* $LicenseInfo:firstyear=2007&license=viewerlgpl$ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
* $/LicenseInfo$ * $/LicenseInfo$
*/ */
#version 120
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
mat4 getSkinnedTransform(); mat4 getSkinnedTransform();
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
* $LicenseInfo:firstyear=2007&license=viewerlgpl$ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
* $/LicenseInfo$ * $/LicenseInfo$
*/ */
#version 120
void default_lighting(); void default_lighting();
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
* $LicenseInfo:firstyear=2007&license=viewerlgpl$ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
* $/LicenseInfo$ * $/LicenseInfo$
*/ */
#version 120
vec4 calcLightingSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor, vec4 baseCol); vec4 calcLightingSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor, vec4 baseCol);
void calcAtmospherics(vec3 inPositionEye); void calcAtmospherics(vec3 inPositionEye);
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
* $LicenseInfo:firstyear=2007&license=viewerlgpl$ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
* $/LicenseInfo$ * $/LicenseInfo$
*/ */
#version 120
uniform sampler2D diffuseMap; uniform sampler2D diffuseMap;
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
* $LicenseInfo:firstyear=2007&license=viewerlgpl$ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
* $/LicenseInfo$ * $/LicenseInfo$
*/ */
#version 120
mat4 getSkinnedTransform(); mat4 getSkinnedTransform();
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
* $LicenseInfo:firstyear=2007&license=viewerlgpl$ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
* $/LicenseInfo$ * $/LicenseInfo$
*/ */
#version 120
#extension GL_ARB_texture_rectangle : enable #extension GL_ARB_texture_rectangle : enable
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
* Copyright (c) 2007-$CurrentYear$, Linden Research, Inc. * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc.
* $License$ * $License$
*/ */
#version 120
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
mat4 getObjectSkinnedTransform(); mat4 getObjectSkinnedTransform();
...@@ -22,6 +24,9 @@ varying vec3 vary_ambient; ...@@ -22,6 +24,9 @@ varying vec3 vary_ambient;
varying vec3 vary_directional; varying vec3 vary_directional;
varying vec3 vary_normal; varying vec3 vary_normal;
varying vec3 vary_light; varying vec3 vary_light;
varying vec3 vary_fragcoord;
uniform float near_clip;
void main() void main()
{ {
...@@ -38,7 +43,8 @@ void main() ...@@ -38,7 +43,8 @@ void main()
norm = gl_Vertex.xyz + gl_Normal.xyz; norm = gl_Vertex.xyz + gl_Normal.xyz;
norm = normalize(( trans*vec4(norm, 1.0) ).xyz-pos.xyz); norm = normalize(( trans*vec4(norm, 1.0) ).xyz-pos.xyz);
gl_Position = gl_ProjectionMatrix * pos; vec4 frag_pos = gl_ProjectionMatrix * pos;
gl_Position = frag_pos;
vary_position = pos.xyz; vary_position = pos.xyz;
vary_normal = norm; vary_normal = norm;
...@@ -70,6 +76,8 @@ void main() ...@@ -70,6 +76,8 @@ void main()
gl_FrontColor = col; gl_FrontColor = col;
gl_FogFragCoord = pos.z; gl_FogFragCoord = pos.z;
vary_fragcoord.xyz = frag_pos.xyz + vec3(0,0,near_clip);
} }
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
* $/LicenseInfo$ * $/LicenseInfo$
*/ */
#version 120
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
void calcAtmospherics(vec3 inPositionEye); void calcAtmospherics(vec3 inPositionEye);
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
uniform sampler2D diffuseMap; uniform sampler2D diffuseMap;
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
* $/LicenseInfo$ * $/LicenseInfo$
*/ */
#version 120
uniform sampler2D diffuseMap; uniform sampler2D diffuseMap;
uniform sampler2DShadow shadowMap0; uniform sampler2DShadow shadowMap0;
uniform sampler2DShadow shadowMap1; uniform sampler2DShadow shadowMap1;
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
* $LicenseInfo:firstyear=2007&license=viewerlgpl$ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
* $/LicenseInfo$ * $/LicenseInfo$
*/ */
#version 120
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
mat4 getSkinnedTransform(); mat4 getSkinnedTransform();
...@@ -21,6 +23,9 @@ varying vec3 vary_position; ...@@ -21,6 +23,9 @@ varying vec3 vary_position;
varying vec3 vary_ambient; varying vec3 vary_ambient;
varying vec3 vary_directional; varying vec3 vary_directional;
varying vec3 vary_normal; varying vec3 vary_normal;
varying vec3 vary_fragcoord;
uniform float near_clip;
void main() void main()
{ {
...@@ -40,7 +45,9 @@ void main() ...@@ -40,7 +45,9 @@ void main()
norm.z = dot(trans[2].xyz, gl_Normal); norm.z = dot(trans[2].xyz, gl_Normal);
norm = normalize(norm); norm = normalize(norm);
gl_Position = gl_ProjectionMatrix * pos; vec4 frag_pos = gl_ProjectionMatrix * pos;
gl_Position = frag_pos;
vary_position = pos.xyz; vary_position = pos.xyz;
vary_normal = norm; vary_normal = norm;
...@@ -71,7 +78,8 @@ void main() ...@@ -71,7 +78,8 @@ void main()
gl_FrontColor = col; gl_FrontColor = col;
gl_FogFragCoord = pos.z; gl_FogFragCoord = pos.z;
vary_fragcoord.xyz = frag_pos.xyz + vec3(0,0,near_clip);
} }
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
* $LicenseInfo:firstyear=2007&license=viewerlgpl$ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
* $/LicenseInfo$ * $/LicenseInfo$
*/ */
#version 120
uniform sampler2D diffuseMap; uniform sampler2D diffuseMap;
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
* $LicenseInfo:firstyear=2007&license=viewerlgpl$ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
* $/LicenseInfo$ * $/LicenseInfo$
*/ */
#version 120
uniform sampler2D diffuseMap; uniform sampler2D diffuseMap;
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
* $LicenseInfo:firstyear=2007&license=viewerlgpl$ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
* $/LicenseInfo$ * $/LicenseInfo$
*/ */
#version 120
mat4 getSkinnedTransform(); mat4 getSkinnedTransform();
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
* $LicenseInfo:firstyear=2007&license=viewerlgpl$ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
* $/LicenseInfo$ * $/LicenseInfo$
*/ */
#version 120
mat4 getSkinnedTransform(); mat4 getSkinnedTransform();
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
* $LicenseInfo:firstyear=2007&license=viewerlgpl$ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
* $/LicenseInfo$ * $/LicenseInfo$
*/ */
#version 120
#extension GL_ARB_texture_rectangle : enable #extension GL_ARB_texture_rectangle : enable
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
* $LicenseInfo:firstyear=2007&license=viewerlgpl$ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
* $/LicenseInfo$ * $/LicenseInfo$
*/ */
#version 120
varying vec2 vary_fragcoord; varying vec2 vary_fragcoord;
uniform vec2 screen_res; uniform vec2 screen_res;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment