merge changes for drtvwr-132

master
Oz Linden 2012-04-03 11:28:56 -04:00
commit fa6add3fcd
124 changed files with 1271 additions and 638 deletions

View File

@ -126,7 +126,7 @@ public:
virtual void addDebugText( const std::string& text ) = 0;
virtual const LLUUID& getID() = 0;
virtual const LLUUID& getID() const = 0;
//-------------------------------------------------------------------------
// End Interface
//-------------------------------------------------------------------------

View File

@ -97,6 +97,8 @@ void APIENTRY gl_debug_callback(GLenum source,
}
#endif
void parse_glsl_version(S32& major, S32& minor);
void ll_init_fail_log(std::string filename)
{
gFailLog.open(filename.c_str());
@ -295,6 +297,7 @@ PFNGLGETACTIVEUNIFORMARBPROC glGetActiveUniformARB = NULL;
PFNGLGETUNIFORMFVARBPROC glGetUniformfvARB = NULL;
PFNGLGETUNIFORMIVARBPROC glGetUniformivARB = NULL;
PFNGLGETSHADERSOURCEARBPROC glGetShaderSourceARB = NULL;
PFNGLVERTEXATTRIBIPOINTERPROC glVertexAttribIPointer = NULL;
#if LL_WINDOWS
PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB = NULL;
@ -443,7 +446,8 @@ LLGLManager::LLGLManager() :
mDriverVersionMinor(0),
mDriverVersionRelease(0),
mGLVersion(1.0f),
mGLSLVersionMajor(0),
mGLSLVersionMinor(0),
mVRAM(0),
mGLMaxVertexRange(0),
mGLMaxIndexRange(0)
@ -554,6 +558,20 @@ bool LLGLManager::initGL()
mGLVersion = mDriverVersionMajor + mDriverVersionMinor * .1f;
if (mGLVersion >= 2.f)
{
parse_glsl_version(mGLSLVersionMajor, mGLSLVersionMinor);
#if LL_DARWIN
//never use GLSL greater than 1.20 on OSX
if (mGLSLVersionMajor > 1 || mGLSLVersionMinor >= 30)
{
mGLSLVersionMajor = 1;
mGLSLVersionMinor = 20;
}
#endif
}
// Trailing space necessary to keep "nVidia Corpor_ati_on" cards
// from being recognized as ATI.
if (mGLVendor.substr(0,4) == "ATI ")
@ -1300,6 +1318,7 @@ void LLGLManager::initExtensions()
glVertexAttrib4uivARB = (PFNGLVERTEXATTRIB4UIVARBPROC) GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib4uivARB");
glVertexAttrib4usvARB = (PFNGLVERTEXATTRIB4USVARBPROC) GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib4usvARB");
glVertexAttribPointerARB = (PFNGLVERTEXATTRIBPOINTERARBPROC) GLH_EXT_GET_PROC_ADDRESS("glVertexAttribPointerARB");
glVertexAttribIPointer = (PFNGLVERTEXATTRIBIPOINTERPROC) GLH_EXT_GET_PROC_ADDRESS("glVertexAttribIPointer");
glEnableVertexAttribArrayARB = (PFNGLENABLEVERTEXATTRIBARRAYARBPROC) GLH_EXT_GET_PROC_ADDRESS("glEnableVertexAttribArrayARB");
glDisableVertexAttribArrayARB = (PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) GLH_EXT_GET_PROC_ADDRESS("glDisableVertexAttribArrayARB");
glProgramStringARB = (PFNGLPROGRAMSTRINGARBPROC) GLH_EXT_GET_PROC_ADDRESS("glProgramStringARB");
@ -2098,6 +2117,55 @@ void parse_gl_version( S32* major, S32* minor, S32* release, std::string* vendor
}
}
void parse_glsl_version(S32& major, S32& minor)
{
// GL_SHADING_LANGUAGE_VERSION returns a null-terminated string with the format:
// <major>.<minor>[.<release>] [<vendor specific>]
const char* version = (const char*) glGetString(GL_SHADING_LANGUAGE_VERSION);
major = 0;
minor = 0;
if( !version )
{
return;
}
std::string ver_copy( version );
S32 len = (S32)strlen( version ); /* Flawfinder: ignore */
S32 i = 0;
S32 start;
// Find the major version
start = i;
for( ; i < len; i++ )
{
if( '.' == version[i] )
{
break;
}
}
std::string major_str = ver_copy.substr(start,i-start);
LLStringUtil::convertToS32(major_str, major);
if( '.' == version[i] )
{
i++;
}
// Find the minor version
start = i;
for( ; i < len; i++ )
{
if( ('.' == version[i]) || isspace(version[i]) )
{
break;
}
}
std::string minor_str = ver_copy.substr(start,i-start);
LLStringUtil::convertToS32(minor_str, minor);
}
LLGLUserClipPlane::LLGLUserClipPlane(const LLPlane& p, const glh::matrix4f& modelview, const glh::matrix4f& projection, bool apply)
{
mApply = apply;

View File

@ -138,6 +138,8 @@ public:
S32 mDriverVersionMinor;
S32 mDriverVersionRelease;
F32 mGLVersion; // e.g = 1.4
S32 mGLSLVersionMajor;
S32 mGLSLVersionMinor;
std::string mDriverVersionVendorString;
S32 mVRAM; // VRAM in MB

View File

@ -199,6 +199,7 @@ extern PFNGLVERTEXATTRIB4UBVARBPROC glVertexAttrib4ubvARB;
extern PFNGLVERTEXATTRIB4UIVARBPROC glVertexAttrib4uivARB;
extern PFNGLVERTEXATTRIB4USVARBPROC glVertexAttrib4usvARB;
extern PFNGLVERTEXATTRIBPOINTERARBPROC glVertexAttribPointerARB;
extern PFNGLVERTEXATTRIBIPOINTERPROC glVertexAttribIPointer;
extern PFNGLENABLEVERTEXATTRIBARRAYARBPROC glEnableVertexAttribArrayARB;
extern PFNGLDISABLEVERTEXATTRIBARRAYARBPROC glDisableVertexAttribArrayARB;
extern PFNGLPROGRAMSTRINGARBPROC glProgramStringARB;
@ -460,6 +461,7 @@ extern PFNGLVERTEXATTRIB4UBVARBPROC glVertexAttrib4ubvARB;
extern PFNGLVERTEXATTRIB4UIVARBPROC glVertexAttrib4uivARB;
extern PFNGLVERTEXATTRIB4USVARBPROC glVertexAttrib4usvARB;
extern PFNGLVERTEXATTRIBPOINTERARBPROC glVertexAttribPointerARB;
extern PFNGLVERTEXATTRIBIPOINTERPROC glVertexAttribIPointer;
extern PFNGLENABLEVERTEXATTRIBARRAYARBPROC glEnableVertexAttribArrayARB;
extern PFNGLDISABLEVERTEXATTRIBARRAYARBPROC glDisableVertexAttribArrayARB;
extern PFNGLPROGRAMSTRINGARBPROC glProgramStringARB;
@ -693,6 +695,7 @@ extern PFNGLVERTEXATTRIB4UBVARBPROC glVertexAttrib4ubvARB;
extern PFNGLVERTEXATTRIB4UIVARBPROC glVertexAttrib4uivARB;
extern PFNGLVERTEXATTRIB4USVARBPROC glVertexAttrib4usvARB;
extern PFNGLVERTEXATTRIBPOINTERARBPROC glVertexAttribPointerARB;
extern PFNGLVERTEXATTRIBIPOINTERPROC glVertexAttribIPointer;
extern PFNGLENABLEVERTEXATTRIBARRAYARBPROC glEnableVertexAttribArrayARB;
extern PFNGLDISABLEVERTEXATTRIBARRAYARBPROC glDisableVertexAttribArrayARB;
extern PFNGLPROGRAMSTRINGARBPROC glProgramStringARB;

View File

@ -109,7 +109,12 @@ void LLGLSLShader::unload()
glGetAttachedObjectsARB(mProgramObject, 1024, &count, obj);
for (GLsizei i = 0; i < count; i++)
{
glDeleteObjectARB(obj[i]);
#if !LL_DARWIN
if (glIsProgramARB(obj[i]))
#endif
{
glDeleteObjectARB(obj[i]);
}
}
glDeleteObjectARB(mProgramObject);
@ -161,8 +166,9 @@ BOOL LLGLSLShader::createShader(vector<string> * attributes,
return FALSE;
}
if (gGLManager.mGLVersion < 3.1f)
{ //attachShaderFeatures may have set the number of indexed texture channels, so set to 1 again
if (gGLManager.mGLSLVersionMajor < 2 && gGLManager.mGLSLVersionMinor < 3)
{ //indexed texture rendering requires GLSL 1.3 or later
//attachShaderFeatures may have set the number of indexed texture channels, so set to 1 again
mFeatures.mIndexedTextureChannels = llmin(mFeatures.mIndexedTextureChannels, 1);
}

View File

@ -575,34 +575,46 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
GLcharARB* text[4096];
GLuint count = 0;
F32 version = gGLManager.mGLVersion;
//hack to never use GLSL > 1.20 on OSX
#if LL_DARWIN
version = llmin(version, 2.9f);
#endif
if (version < 2.1f)
S32 major_version = gGLManager.mGLSLVersionMajor;
S32 minor_version = gGLManager.mGLSLVersionMinor;
if (major_version == 1 && minor_version < 30)
{
text[count++] = strdup("#version 110\n");
text[count++] = strdup("#define ATTRIBUTE attribute\n");
text[count++] = strdup("#define VARYING varying\n");
}
else if (version < 3.3f)
{
//set version to 1.20
text[count++] = strdup("#version 120\n");
text[count++] = strdup("#define FXAA_GLSL_120 1\n");
text[count++] = strdup("#define FXAA_FAST_PIXEL_OFFSET 0\n");
text[count++] = strdup("#define ATTRIBUTE attribute\n");
text[count++] = strdup("#define VARYING varying\n");
if (minor_version < 10)
{
//should NEVER get here -- if major version is 1 and minor version is less than 10,
// viewer should never attempt to use shaders, continuing will result in undefined behavior
llerrs << "Unsupported GLSL Version." << llendl;
}
if (minor_version <= 19)
{
text[count++] = strdup("#version 110\n");
text[count++] = strdup("#define ATTRIBUTE attribute\n");
text[count++] = strdup("#define VARYING varying\n");
text[count++] = strdup("#define VARYING_FLAT varying\n");
}
else if (minor_version <= 29)
{
//set version to 1.20
text[count++] = strdup("#version 120\n");
text[count++] = strdup("#define FXAA_GLSL_120 1\n");
text[count++] = strdup("#define FXAA_FAST_PIXEL_OFFSET 0\n");
text[count++] = strdup("#define ATTRIBUTE attribute\n");
text[count++] = strdup("#define VARYING varying\n");
text[count++] = strdup("#define VARYING_FLAT varying\n");
}
}
else
{
if (version < 4.f)
if (major_version < 4)
{
//set version to 1.30
text[count++] = strdup("#version 130\n");
//some implementations of GLSL 1.30 require integer precision be explicitly declared
text[count++] = strdup("precision mediump int;\n");
text[count++] = strdup("precision highp float;\n");
}
else
{ //set version to 400
@ -618,16 +630,25 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
{ //"varying" state is "out" in a vertex program, "in" in a fragment program
// ("varying" is deprecated after version 1.20)
text[count++] = strdup("#define VARYING out\n");
text[count++] = strdup("#define VARYING_FLAT flat out\n");
}
else
{
text[count++] = strdup("#define VARYING in\n");
text[count++] = strdup("#define VARYING_FLAT flat in\n");
}
//backwards compatibility with legacy texture lookup syntax
text[count++] = strdup("#define texture2D texture\n");
text[count++] = strdup("#define textureCube texture\n");
text[count++] = strdup("#define texture2DLod textureLod\n");
text[count++] = strdup("#define shadow2D(a,b) vec2(texture(a,b))\n");
if (major_version > 1 || minor_version >= 40)
{ //GLSL 1.40 replaces texture2DRect et al with texture
text[count++] = strdup("#define texture2DRect texture\n");
text[count++] = strdup("#define shadow2DRect(a,b) vec2(texture(a,b))\n");
}
}
//copy preprocessor definitions into buffer
@ -651,22 +672,24 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
.
uniform sampler2D texN;
VARYING float vary_texture_index;
VARYING_FLAT ivec4 vary_texture_index;
vec4 ret = vec4(1,0,1,1);
vec4 diffuseLookup(vec2 texcoord)
{
switch (int(vary_texture_index+0.25))
switch (vary_texture_index.r))
{
case 0: return texture2D(tex0, texcoord);
case 1: return texture2D(tex1, texcoord);
case 2: return texture2D(tex2, texcoord);
case 0: ret = texture2D(tex0, texcoord); break;
case 1: ret = texture2D(tex1, texcoord); break;
case 2: ret = texture2D(tex2, texcoord); break;
.
.
.
case N: return texture2D(texN, texcoord);
case N: return texture2D(texN, texcoord); break;
}
return vec4(0,0,0,0);
return ret;
}
*/
@ -679,7 +702,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
if (texture_index_channels > 1)
{
text[count++] = strdup("VARYING float vary_texture_index;\n");
text[count++] = strdup("VARYING_FLAT ivec4 vary_texture_index;\n");
}
text[count++] = strdup("vec4 diffuseLookup(vec2 texcoord)\n");
@ -691,45 +714,28 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
text[count++] = strdup("return texture2D(tex0, texcoord);\n");
text[count++] = strdup("}\n");
}
else if (gGLManager.mGLVersion >= 3.f)
{
text[count++] = strdup("\tswitch (int(vary_texture_index+0.25))\n");
else if (major_version > 1 || minor_version >= 30)
{ //switches are supported in GLSL 1.30 and later
text[count++] = strdup("\tvec4 ret = vec4(1,0,1,1);\n");
text[count++] = strdup("\tswitch (vary_texture_index.r)\n");
text[count++] = strdup("\t{\n");
//switch body
for (S32 i = 0; i < texture_index_channels; ++i)
{
std::string case_str = llformat("\t\tcase %d: return texture2D(tex%d, texcoord);\n", i, i);
std::string case_str = llformat("\t\tcase %d: ret = texture2D(tex%d, texcoord); break;\n", i, i);
text[count++] = strdup(case_str.c_str());
}
text[count++] = strdup("\t}\n");
text[count++] = strdup("\treturn vec4(1,0,1,1);\n");
text[count++] = strdup("\treturn ret;\n");
text[count++] = strdup("}\n");
}
else
{
//switches aren't supported, make block that looks like:
/*
int ti = int(vary_texture_index+0.25);
if (ti == 0) return texture2D(tex0, texcoord);
if (ti == 1) return texture2D(tex1, texcoord);
.
.
.
if (ti == N) return texture2D(texN, texcoord);
*/
text[count++] = strdup("int ti = int(vary_texture_index+0.25);\n");
for (S32 i = 0; i < texture_index_channels; ++i)
{
std::string if_str = llformat("if (ti == %d) return texture2D(tex%d, texcoord);\n", i, i);
text[count++] = strdup(if_str.c_str());
}
text[count++] = strdup("\treturn vec4(1,0,1,1);\n");
text[count++] = strdup("}\n");
}
{ //should never get here. Indexed texture rendering requires GLSL 1.30 or later
// (for passing integers between vertex and fragment shaders)
llerrs << "Indexed texture rendering requires GLSL 1.30 or later." << llendl;
}
}
//copy file into memory
@ -1070,6 +1076,8 @@ void LLShaderMgr::initAttribsAndUniforms()
mReservedUniforms.push_back("magnification");
mReservedUniforms.push_back("max_cof");
mReservedUniforms.push_back("res_scale");
mReservedUniforms.push_back("dof_width");
mReservedUniforms.push_back("dof_height");
mReservedUniforms.push_back("depthMap");
mReservedUniforms.push_back("shadowMap0");

View File

@ -142,6 +142,8 @@ public:
DOF_MAGNIFICATION,
DOF_MAX_COF,
DOF_RES_SCALE,
DOF_WIDTH,
DOF_HEIGHT,
DEFERRED_DEPTH,
DEFERRED_SHADOW0,

View File

@ -284,6 +284,12 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask)
{
bool error = false;
if (gGLManager.mGLSLVersionMajor < 2 && gGLManager.mGLSLVersionMinor < 30)
{
//make sure texture index is disabled
data_mask = data_mask & ~MAP_TEXTURE_INDEX;
}
if (LLGLSLShader::sNoFixedFunction)
{
for (U32 i = 0; i < TYPE_MAX; ++i)
@ -1193,7 +1199,7 @@ void LLVertexBuffer::setupVertexArray()
1, //TYPE_WEIGHT,
4, //TYPE_WEIGHT4,
4, //TYPE_CLOTHWEIGHT,
1, //TYPE_TEXTURE_INDEX
4, //TYPE_TEXTURE_INDEX
};
U32 attrib_type[] =
@ -1210,7 +1216,24 @@ void LLVertexBuffer::setupVertexArray()
GL_FLOAT, //TYPE_WEIGHT,
GL_FLOAT, //TYPE_WEIGHT4,
GL_FLOAT, //TYPE_CLOTHWEIGHT,
GL_FLOAT, //TYPE_TEXTURE_INDEX
GL_UNSIGNED_BYTE, //TYPE_TEXTURE_INDEX
};
bool attrib_integer[] =
{
false, //TYPE_VERTEX,
false, //TYPE_NORMAL,
false, //TYPE_TEXCOORD0,
false, //TYPE_TEXCOORD1,
false, //TYPE_TEXCOORD2,
false, //TYPE_TEXCOORD3,
false, //TYPE_COLOR,
false, //TYPE_EMISSIVE,
false, //TYPE_BINORMAL,
false, //TYPE_WEIGHT,
false, //TYPE_WEIGHT4,
false, //TYPE_CLOTHWEIGHT,
true, //TYPE_TEXTURE_INDEX
};
U32 attrib_normalized[] =
@ -1238,7 +1261,21 @@ void LLVertexBuffer::setupVertexArray()
if (mTypeMask & (1 << i))
{
glEnableVertexAttribArrayARB(i);
glVertexAttribPointerARB(i, attrib_size[i], attrib_type[i], attrib_normalized[i], sTypeSize[i], (void*) mOffsets[i]);
if (attrib_integer[i])
{
#if !LL_DARWIN
//glVertexattribIPointer requires GLSL 1.30 or later
if (gGLManager.mGLSLVersionMajor > 1 || gGLManager.mGLSLVersionMinor >= 30)
{
glVertexAttribIPointer(i, attrib_size[i], attrib_type[i], sTypeSize[i], (void*) mOffsets[i]);
}
#endif
}
else
{
glVertexAttribPointerARB(i, attrib_size[i], attrib_type[i], attrib_normalized[i], sTypeSize[i], (void*) mOffsets[i]);
}
}
else
{
@ -2220,11 +2257,14 @@ void LLVertexBuffer::setupVertexBuffer(U32 data_mask)
void* ptr = (void*)(base + mOffsets[TYPE_CLOTHWEIGHT]);
glVertexAttribPointerARB(loc, 4, GL_FLOAT, GL_TRUE, LLVertexBuffer::sTypeSize[TYPE_CLOTHWEIGHT], ptr);
}
if (data_mask & MAP_TEXTURE_INDEX)
if (data_mask & MAP_TEXTURE_INDEX &&
(gGLManager.mGLSLVersionMajor >= 2 || gGLManager.mGLSLVersionMinor >= 30)) //indexed texture rendering requires GLSL 1.30 or later
{
#if !LL_DARWIN
S32 loc = TYPE_TEXTURE_INDEX;
void *ptr = (void*) (base + mOffsets[TYPE_VERTEX] + 12);
glVertexAttribPointerARB(loc, 1, GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_VERTEX], ptr);
glVertexAttribIPointer(loc, 4, GL_UNSIGNED_BYTE, LLVertexBuffer::sTypeSize[TYPE_VERTEX], ptr);
#endif
}
if (data_mask & MAP_VERTEX)
{

View File

@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
VARYING vec4 vertex_color;
@ -34,5 +36,5 @@ uniform sampler2D diffuseMap;
void main()
{
gl_FragColor = vec4(vertex_color.rgb, texture2D(diffuseMap, vary_texcoord0.xy).a);
frag_color = vec4(vertex_color.rgb, texture2D(diffuseMap, vary_texcoord0.xy).a);
}

View File

@ -26,15 +26,15 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2DRect depthMap;
vec4 diffuseLookup(vec2 texcoord);
uniform mat4 shadow_matrix[6];
uniform vec4 shadow_clip;
uniform vec2 screen_res;
vec3 atmosLighting(vec3 light);
@ -69,6 +69,6 @@ void main()
color.rgb += diff.rgb * vary_pointlight_col.rgb;
gl_FragColor = color;
frag_color = color;
}

View File

@ -26,15 +26,15 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2DRect depthMap;
uniform sampler2D diffuseMap;
uniform mat4 shadow_matrix[6];
uniform vec4 shadow_clip;
uniform vec2 screen_res;
vec3 atmosLighting(vec3 light);
@ -81,9 +81,9 @@ void main()
color.rgb += diff.rgb * vary_pointlight_col.rgb;
gl_FragColor = color;
//gl_FragColor = vec4(1,0,1,1);
//gl_FragColor = vec4(1,0,1,1)*shadow;
frag_color = color;
//frag_color = vec4(1,0,1,1);
//frag_color = vec4(1,0,1,1)*shadow;
}

View File

@ -26,14 +26,14 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2DRect depthMap;
uniform sampler2D diffuseMap;
uniform mat4 shadow_matrix[6];
uniform vec4 shadow_clip;
uniform vec2 screen_res;
vec3 atmosLighting(vec3 light);
@ -79,6 +79,6 @@ void main()
color.rgb += diff.rgb * vary_pointlight_col.rgb;
gl_FragColor = color;
frag_color = color;
}

View File

@ -41,7 +41,6 @@ vec3 atmosAffectDirectionalLight(float lightIntensity);
VARYING vec3 vary_position;
VARYING vec3 vary_ambient;
VARYING vec3 vary_directional;
VARYING vec3 vary_normal;
VARYING vec3 vary_fragcoord;
VARYING vec3 vary_pointlight_col;
VARYING vec4 vertex_color;
@ -110,8 +109,7 @@ void main()
gl_Position = frag_pos;
vary_position = pos.xyz;
vary_normal = norm;
calcAtmospherics(pos.xyz);
vec4 col = vec4(0.0, 0.0, 0.0, diffuse_color.a);

View File

@ -48,7 +48,6 @@ VARYING vec3 vary_ambient;
VARYING vec3 vary_directional;
VARYING vec3 vary_fragcoord;
VARYING vec3 vary_position;
VARYING vec3 vary_light;
VARYING vec3 vary_pointlight_col;
VARYING vec4 vertex_color;
@ -134,8 +133,6 @@ void main()
// Add windlight lights
col.rgb = atmosAmbient(vec3(0.));
vary_light = light_position[0].xyz;
vary_ambient = col.rgb*diffuse_color.rgb;
vary_directional.rgb = diffuse_color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, light_position[0].xyz), (1.0-diffuse_color.a)*(1.0-diffuse_color.a)));

View File

@ -23,17 +23,17 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2D diffuseMap;
VARYING vec4 vertex_color;
VARYING vec2 vary_texcoord0;
void main()
{
//gl_FragColor = vec4(1,1,1,vertex_color.a * texture2D(diffuseMap, vary_texcoord0.xy).a);
gl_FragColor = vec4(1,1,1,1);
frag_color = vec4(1,1,1,1);
}

View File

@ -27,11 +27,8 @@ uniform mat4 modelview_matrix;
uniform mat4 texture_matrix0;
ATTRIBUTE vec3 position;
ATTRIBUTE vec4 diffuse_color;
ATTRIBUTE vec2 texcoord0;
VARYING vec4 vertex_color;
mat4 getObjectSkinnedTransform();
void main()
@ -42,8 +39,6 @@ void main()
mat = modelview_matrix * mat;
vec3 pos = (mat*vec4(position.xyz, 1.0)).xyz;
vertex_color = diffuse_color;
vec4 p = projection_matrix * vec4(pos, 1.0);
p.z = max(p.z, -p.w+0.01);
gl_Position = p;

View File

@ -0,0 +1,148 @@
/**
* @file avatarAlphaNoColorV.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 projection_matrix;
ATTRIBUTE vec3 position;
ATTRIBUTE vec3 normal;
ATTRIBUTE vec2 texcoord0;
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
mat4 getSkinnedTransform();
void calcAtmospherics(vec3 inPositionEye);
float calcDirectionalLight(vec3 n, vec3 l);
float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight);
vec3 atmosAmbient(vec3 light);
vec3 atmosAffectDirectionalLight(float lightIntensity);
vec3 scaleDownLight(vec3 light);
vec3 scaleUpLight(vec3 light);
VARYING vec3 vary_position;
VARYING vec3 vary_ambient;
VARYING vec3 vary_directional;
VARYING vec3 vary_fragcoord;
VARYING vec3 vary_pointlight_col;
VARYING vec2 vary_texcoord0;
uniform float near_clip;
uniform vec4 color;
uniform vec4 light_position[8];
uniform vec3 light_direction[8];
uniform vec3 light_attenuation[8];
uniform vec3 light_diffuse[8];
float calcDirectionalLight(vec3 n, vec3 l)
{
float a = max(dot(n,l),0.0);
return a;
}
float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight)
{
//get light vector
vec3 lv = lp.xyz-v;
//get distance
float d = dot(lv,lv);
float da = 0.0;
if (d > 0.0 && la > 0.0 && fa > 0.0)
{
//normalize light vector
lv = normalize(lv);
//distance attenuation
float dist2 = d/la;
da = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0);
// spotlight coefficient.
float spot = max(dot(-ln, lv), is_pointlight);
da *= spot*spot; // GL_SPOT_EXPONENT=2
//angular attenuation
da *= max(dot(n, lv), 0.0);
}
return da;
}
void main()
{
vary_texcoord0 = texcoord0;
vec4 pos;
vec3 norm;
mat4 trans = getSkinnedTransform();
vec4 pos_in = vec4(position.xyz, 1.0);
pos.x = dot(trans[0], pos_in);
pos.y = dot(trans[1], pos_in);
pos.z = dot(trans[2], pos_in);
pos.w = 1.0;
norm.x = dot(trans[0].xyz, normal);
norm.y = dot(trans[1].xyz, normal);
norm.z = dot(trans[2].xyz, normal);
norm = normalize(norm);
vec4 frag_pos = projection_matrix * pos;
gl_Position = frag_pos;
vary_position = pos.xyz;
calcAtmospherics(pos.xyz);
vec4 col = vec4(0.0, 0.0, 0.0, 1.0);
// Collect normal lights
col.rgb += light_diffuse[2].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[2], light_direction[2], light_attenuation[2].x, light_attenuation[2].y, light_attenuation[2].z);
col.rgb += light_diffuse[3].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[3], light_direction[3], light_attenuation[3].x, light_attenuation[3].y, light_attenuation[3].z);
col.rgb += light_diffuse[4].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[4], light_direction[4], light_attenuation[4].x, light_attenuation[4].y, light_attenuation[4].z);
col.rgb += light_diffuse[5].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[5], light_direction[5], light_attenuation[5].x, light_attenuation[5].y, light_attenuation[5].z);
col.rgb += light_diffuse[6].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[6], light_direction[6], light_attenuation[6].x, light_attenuation[6].y, light_attenuation[6].z);
col.rgb += light_diffuse[7].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[7], light_direction[7], light_attenuation[7].x, light_attenuation[7].y, light_attenuation[7].z);
vary_pointlight_col = col.rgb*color.rgb;
col.rgb = vec3(0,0,0);
// Add windlight lights
col.rgb = atmosAmbient(vec3(0.));
vary_ambient = col.rgb*color.rgb;
vary_directional = color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, light_position[0].xyz), 0.0));
col.rgb = col.rgb * color.rgb;
vary_fragcoord.xyz = frag_pos.xyz + vec3(0,0,near_clip);
}

View File

@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragData[3];
out vec4 frag_data[3];
#else
#define frag_data gl_FragData
#endif
uniform sampler2D diffuseMap;
@ -41,9 +43,9 @@ void main()
discard;
}
gl_FragData[0] = vec4(diff.rgb, 0.0);
gl_FragData[1] = vec4(0,0,0,0);
frag_data[0] = vec4(diff.rgb, 0.0);
frag_data[1] = vec4(0,0,0,0);
vec3 nvn = normalize(vary_normal);
gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
frag_data[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
}

View File

@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2D diffuseMap;
@ -33,7 +35,7 @@ VARYING vec4 post_pos;
void main()
{
gl_FragColor = vec4(1,1,1,1);
frag_color = vec4(1,1,1,1);
gl_FragDepth = max(post_pos.z/post_pos.w*0.5+0.5, 0.0);
}

View File

@ -26,7 +26,9 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2DRect depthMap;
@ -111,6 +113,6 @@ void main()
col /= defined_weight.xyxx;
col.y *= col.y;
gl_FragColor = col;
frag_color = col;
}

View File

@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragData[3];
out vec4 frag_data[3];
#else
#define frag_data gl_FragData
#endif
uniform sampler2D diffuseMap;
@ -46,9 +48,9 @@ void main()
dot(norm,vary_mat1),
dot(norm,vary_mat2));
gl_FragData[0] = vec4(col, 0.0);
gl_FragData[1] = vertex_color.aaaa; // spec
//gl_FragData[1] = vec4(vec3(vertex_color.a), vertex_color.a+(1.0-vertex_color.a)*vertex_color.a); // spec - from former class3 - maybe better, but not so well tested
frag_data[0] = vec4(col, 0.0);
frag_data[1] = vertex_color.aaaa; // spec
//frag_data[1] = vec4(vec3(vertex_color.a), vertex_color.a+(1.0-vertex_color.a)*vertex_color.a); // spec - from former class3 - maybe better, but not so well tested
vec3 nvn = normalize(tnorm);
gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
frag_data[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
}

View File

@ -30,7 +30,7 @@ ATTRIBUTE vec3 position;
ATTRIBUTE vec4 diffuse_color;
ATTRIBUTE vec3 normal;
ATTRIBUTE vec2 texcoord0;
ATTRIBUTE vec2 texcoord2;
ATTRIBUTE vec3 binormal;
VARYING vec3 vary_mat0;
VARYING vec3 vary_mat1;
@ -52,7 +52,7 @@ void main()
vec3 n = normalize((mat * vec4(normal.xyz+position.xyz, 1.0)).xyz-pos.xyz);
vec3 b = normalize((mat * vec4(vec4(texcoord2,0,1).xyz+position.xyz, 1.0)).xyz-pos.xyz);
vec3 b = normalize((mat * vec4(binormal.xyz+position.xyz, 1.0)).xyz-pos.xyz);
vec3 t = cross(b, n);
vary_mat0 = vec3(t.x, b.x, n.x);

View File

@ -25,7 +25,9 @@
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragData[3];
out vec4 frag_data[3];
#else
#define frag_data gl_FragData
#endif
/////////////////////////////////////////////////////////////////////////
@ -98,8 +100,8 @@ void main()
color *= 2.;
/// Gamma correct for WL (soft clip effect).
gl_FragData[0] = vec4(scaleSoftClip(color.rgb), alpha1);
gl_FragData[1] = vec4(0.0,0.0,0.0,0.0);
gl_FragData[2] = vec4(0,0,1,0);
frag_data[0] = vec4(scaleSoftClip(color.rgb), alpha1);
frag_data[1] = vec4(0.0,0.0,0.0,0.0);
frag_data[2] = vec4(0,0,1,0);
}

View File

@ -26,7 +26,9 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2DRect diffuseRect;
@ -83,6 +85,6 @@ void main()
sc = max(sc, -max_cof);
vec4 bloom = texture2D(bloomMap, vary_fragcoord.xy/screen_res);
gl_FragColor.rgb = diff.rgb + bloom.rgb;
gl_FragColor.a = sc/max_cof*0.5+0.5;
frag_color.rgb = diff.rgb + bloom.rgb;
frag_color.a = sc/max_cof*0.5+0.5;
}

View File

@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragData[3];
out vec4 frag_data[3];
#else
#define frag_data gl_FragData
#endif
uniform float minimum_alpha;
@ -44,9 +46,9 @@ void main()
discard;
}
gl_FragData[0] = vec4(col.rgb, 0.0);
gl_FragData[1] = vec4(0,0,0,0); // spec
frag_data[0] = vec4(col.rgb, 0.0);
frag_data[1] = vec4(0,0,0,0); // spec
vec3 nvn = normalize(vary_normal);
gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
frag_data[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
}

View File

@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragData[3];
out vec4 frag_data[3];
#else
#define frag_data gl_FragData
#endif
VARYING vec3 vary_normal;
@ -43,8 +45,8 @@ void main()
discard;
}
gl_FragData[0] = vec4(col.rgb, 0.0);
gl_FragData[1] = vec4(0,0,0,0);
frag_data[0] = vec4(col.rgb, 0.0);
frag_data[1] = vec4(0,0,0,0);
vec3 nvn = normalize(vary_normal);
gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
frag_data[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
}

View File

@ -25,7 +25,9 @@
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragData[3];
out vec4 frag_data[3];
#else
#define frag_data gl_FragData
#endif
uniform float minimum_alpha;
@ -44,9 +46,9 @@ void main()
discard;
}
gl_FragData[0] = vec4(col.rgb, 0.0);
gl_FragData[1] = vec4(0,0,0,0); // spec
frag_data[0] = vec4(col.rgb, 0.0);
frag_data[1] = vec4(0,0,0,0); // spec
vec3 nvn = normalize(vary_normal);
gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
frag_data[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
}

View File

@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragData[3];
out vec4 frag_data[3];
#else
#define frag_data gl_FragData
#endif
uniform sampler2D diffuseMap;
@ -36,10 +38,10 @@ VARYING vec2 vary_texcoord0;
void main()
{
vec3 col = vertex_color.rgb * texture2D(diffuseMap, vary_texcoord0.xy).rgb;
gl_FragData[0] = vec4(col, 0.0);
gl_FragData[1] = vertex_color.aaaa; // spec
//gl_FragData[1] = vec4(vec3(vertex_color.a), vertex_color.a+(1.0-vertex_color.a)*vertex_color.a); // spec - from former class3 - maybe better, but not so well tested
frag_data[0] = vec4(col, 0.0);
frag_data[1] = vertex_color.aaaa; // spec
//frag_data[1] = vec4(vec3(vertex_color.a), vertex_color.a+(1.0-vertex_color.a)*vertex_color.a); // spec - from former class3 - maybe better, but not so well tested
vec3 nvn = normalize(vary_normal);
gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
frag_data[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
}

View File

@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragData[3];
out vec4 frag_data[3];
#else
#define frag_data gl_FragData
#endif
VARYING vec3 vary_normal;
@ -35,9 +37,9 @@ void main()
{
vec3 col = vertex_color.rgb * diffuseLookup(vary_texcoord0.xy).rgb;
gl_FragData[0] = vec4(col, 0.0);
gl_FragData[1] = vertex_color.aaaa; // spec
//gl_FragData[1] = vec4(vec3(vertex_color.a), vertex_color.a+(1.0-vertex_color.a)*vertex_color.a); // spec - from former class3 - maybe better, but not so well tested
frag_data[0] = vec4(col, 0.0);
frag_data[1] = vertex_color.aaaa; // spec
//frag_data[1] = vec4(vec3(vertex_color.a), vertex_color.a+(1.0-vertex_color.a)*vertex_color.a); // spec - from former class3 - maybe better, but not so well tested
vec3 nvn = normalize(vary_normal);
gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
frag_data[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
}

View File

@ -26,7 +26,9 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2DRect diffuseRect;
@ -37,14 +39,24 @@ uniform vec2 screen_res;
uniform float max_cof;
uniform float res_scale;
uniform float dof_width;
uniform float dof_height;
VARYING vec2 vary_fragcoord;
vec4 dofSample(sampler2DRect tex, vec2 tc)
{
tc.x = min(tc.x, dof_width);
tc.y = min(tc.y, dof_height);
return texture2DRect(tex, tc);
}
void main()
{
vec2 tc = vary_fragcoord.xy;
vec4 dof = texture2DRect(diffuseRect, vary_fragcoord.xy*res_scale);
vec4 dof = dofSample(diffuseRect, vary_fragcoord.xy*res_scale);
vec4 diff = texture2DRect(lightMap, vary_fragcoord.xy);
@ -63,5 +75,5 @@ void main()
diff = mix(diff, col*0.25, a);
}
gl_FragColor = mix(diff, dof, a);
frag_color = mix(diff, dof, a);
}

View File

@ -26,7 +26,9 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
vec3 fullbrightAtmosTransport(vec3 light);
@ -45,6 +47,6 @@ void main()
color.rgb = fullbrightScaleSoftClip(color.rgb);
gl_FragColor = color;
frag_color = color;
}

View File

@ -26,7 +26,9 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
VARYING vec4 vertex_color;
@ -46,6 +48,6 @@ void main()
color.rgb = fullbrightScaleSoftClip(color.rgb);
gl_FragColor = color;
frag_color = color;
}

View File

@ -26,7 +26,9 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
#define FXAA_PC 1
@ -341,18 +343,23 @@ A. Or use FXAA_GREEN_AS_LUMA.
// 1 = API supports gather4 on alpha channel.
// 0 = API does not support gather4 on alpha channel.
//
#if (FXAA_GLSL_130 == 0)
#define FXAA_GATHER4_ALPHA 0
#endif
#if (FXAA_HLSL_5 == 1)
#define FXAA_GATHER4_ALPHA 1
#endif
#ifdef GL_ARB_gpu_shader5
#define FXAA_GATHER4_ALPHA 1
#endif
#ifdef GL_NV_gpu_shader5
#define FXAA_GATHER4_ALPHA 1
#endif
#ifndef FXAA_GATHER4_ALPHA
#define FXAA_GATHER4_ALPHA 0
#endif
#ifdef GL_ARB_gpu_shader5
#define FXAA_GATHER4_ALPHA 1
#endif
#ifdef GL_NV_gpu_shader5
#define FXAA_GATHER4_ALPHA 1
#endif
#ifndef FXAA_GATHER4_ALPHA
#define FXAA_GATHER4_ALPHA 0
#endif
#endif
#endif
/*============================================================================
@ -2113,6 +2120,6 @@ void main()
//diff = texture2D(diffuseMap, vary_tc);
gl_FragColor = diff;
frag_color = diff;
}

View File

@ -26,7 +26,9 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2DRect depthMap;
@ -184,5 +186,5 @@ void main()
vec3 norm = texture2DRect(normalMap, pos_screen).xyz;
norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm
gl_FragColor.xyz = giAmbient(pos, norm);
frag_color.xyz = giAmbient(pos, norm);
}

View File

@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragData[3];
out vec4 frag_data[3];
#else
#define frag_data gl_FragData
#endif
uniform float minimum_alpha;
@ -45,7 +47,7 @@ void main()
discard;
}
gl_FragData[0] = vec4(col.rgb, col.a * 0.005);
gl_FragData[1] = texture2D(specularMap, vary_texcoord0.xy);
gl_FragData[2] = vec4(texture2D(normalMap, vary_texcoord0.xy).xyz, 0.0);
frag_data[0] = vec4(col.rgb, col.a * 0.005);
frag_data[1] = texture2D(specularMap, vary_texcoord0.xy);
frag_data[2] = vec4(texture2D(normalMap, vary_texcoord0.xy).xyz, 0.0);
}

View File

@ -26,12 +26,14 @@
uniform sampler2DRect diffuseMap;
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
VARYING vec2 vary_fragcoord;
void main()
{
gl_FragColor = texture2DRect(diffuseMap, vary_fragcoord.xy);
frag_color = texture2DRect(diffuseMap, vary_fragcoord.xy);
}

View File

@ -26,7 +26,9 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2DRect depthMap;
@ -141,6 +143,6 @@ void main()
discard;
}
gl_FragColor.rgb = out_col;
gl_FragColor.a = 0.0;
frag_color.rgb = out_col;
frag_color.a = 0.0;
}

View File

@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
//class 1 -- no shadows
@ -242,6 +244,6 @@ void main()
}
}
gl_FragColor.rgb = col;
gl_FragColor.a = 0.0;
frag_color.rgb = col;
frag_color.a = 0.0;
}

View File

@ -26,7 +26,9 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2D alphaMap;
@ -52,5 +54,5 @@ void main()
norm *= 0.5;
norm += 0.5;
gl_FragColor = vec4(norm, alpha);
frag_color = vec4(norm, alpha);
}

View File

@ -26,7 +26,9 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2DRect diffuseRect;
@ -118,6 +120,6 @@ void main()
discard;
}
gl_FragColor.rgb = col;
gl_FragColor.a = 0.0;
frag_color.rgb = col;
frag_color.a = 0.0;
}

View File

@ -26,7 +26,9 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2DRect diffuseRect;
@ -122,5 +124,5 @@ void main()
diff /= w;
}
gl_FragColor = diff;
frag_color = diff;
}

View File

@ -26,7 +26,9 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2DRect diffuseRect;
@ -40,6 +42,6 @@ void main()
vec4 diff = texture2DRect(diffuseRect, vary_fragcoord.xy);
vec4 bloom = texture2D(bloomMap, vary_fragcoord.xy/screen_res);
gl_FragColor = diff + bloom;
frag_color = diff + bloom;
}

View File

@ -1,5 +1,5 @@
/**
* @file postgiV.glsl
* @file postDeferredV.glsl
*
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
* Second Life Viewer Source Code
@ -24,17 +24,17 @@
*/
uniform mat4 modelview_projection_matrix;
ATTRIBUTE vec3 position;
VARYING vec2 vary_fragcoord;
uniform vec2 screen_res;
void main()
{
//transform vertex
vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0);
gl_Position = pos;
gl_Position = pos;
vary_fragcoord = (pos.xy*0.5+0.5)*screen_res;
}

View File

@ -24,8 +24,10 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
#endif
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2DRect depthMap;
uniform sampler2DRect normalMap;
@ -96,5 +98,5 @@ void main()
col = col*col*blur_quad.x + col*blur_quad.y + blur_quad.z;
gl_FragColor.rgb = col;
frag_color.rgb = col;
}

View File

@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform float minimum_alpha;
@ -44,7 +46,7 @@ void main()
discard;
}
gl_FragColor = vec4(1,1,1,1);
frag_color = vec4(1,1,1,1);
gl_FragDepth = max(post_pos.z/post_pos.w*0.5+0.5, 0.0);
}

View File

@ -24,14 +24,16 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
VARYING vec4 post_pos;
void main()
{
gl_FragColor = vec4(1,1,1,1);
frag_color = vec4(1,1,1,1);
gl_FragDepth = max(post_pos.z/post_pos.w*0.5+0.5, 0.0);
}

View File

@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragData[3];
out vec4 frag_data[3];
#else
#define frag_data gl_FragData
#endif
/////////////////////////////////////////////////////////////////////////
@ -57,8 +59,8 @@ void main()
color *= 2.;
/// Gamma correct for WL (soft clip effect).
gl_FragData[0] = vec4(scaleSoftClip(color.rgb), 1.0);
gl_FragData[1] = vec4(0.0,0.0,0.0,0.0);
gl_FragData[2] = vec4(0,0,1,0);
frag_data[0] = vec4(scaleSoftClip(color.rgb), 1.0);
frag_data[1] = vec4(0.0,0.0,0.0,0.0);
frag_data[2] = vec4(0,0,1,0);
}

View File

@ -26,7 +26,6 @@
uniform mat4 modelview_projection_matrix;
ATTRIBUTE vec3 position;
ATTRIBUTE vec2 texcoord0;
// SKY ////////////////////////////////////////////////////////////////////////
// The vertex shader for creating the atmospheric sky
@ -34,7 +33,6 @@ ATTRIBUTE vec2 texcoord0;
// Output parameters
VARYING vec4 vary_HazeColor;
VARYING vec2 vary_texcoord0;
// Inputs
uniform vec3 camPosLocal;
@ -60,8 +58,7 @@ void main()
// World / view / projection
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
vary_texcoord0 = texcoord0;
// Get relative position
vec3 P = position.xyz - camPosLocal.xyz + vec3(0,50,0);
//vec3 P = position.xyz + vec3(0,50,0);

View File

@ -26,7 +26,9 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2DRect diffuseRect;
@ -322,7 +324,7 @@ void main()
col = diffuse.rgb;
}
gl_FragColor.rgb = col;
frag_color.rgb = col;
gl_FragColor.a = bloom;
frag_color.a = bloom;
}

View File

@ -27,7 +27,9 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2DRect diffuseRect;
@ -184,6 +186,6 @@ void main()
}
}
gl_FragColor.rgb = col;
gl_FragColor.a = 0.0;
frag_color.rgb = col;
frag_color.a = 0.0;
}

View File

@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragData[3];
out vec4 frag_data[3];
#else
#define frag_data gl_FragData
#endif
VARYING vec4 vertex_color;
@ -36,7 +38,7 @@ void main()
{
vec4 col = vertex_color * texture2D(diffuseMap, vary_texcoord0.xy);
gl_FragData[0] = col;
gl_FragData[1] = vec4(0,0,0,0);
gl_FragData[2] = vec4(0,0,1,0);
frag_data[0] = col;
frag_data[1] = vec4(0,0,0,0);
frag_data[2] = vec4(0,0,1,0);
}

View File

@ -28,10 +28,12 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
void main()
{
gl_FragColor = vec4(0,0,0,0);
frag_color = vec4(0,0,0,0);
}

View File

@ -1,5 +1,5 @@
/**
* @file giV.glsl
* @file sunLightF.glsl
*
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
* Second Life Viewer Source Code
@ -24,13 +24,8 @@
*/
uniform mat4 modelview_projection_matrix;
ATTRIBUTE vec3 position;
ATTRIBUTE vec4 diffuse_color;
ATTRIBUTE vec2 texcoord0;
VARYING vec4 vertex_color;
VARYING vec2 vary_fragcoord;
uniform vec2 screen_res;
@ -39,10 +34,4 @@ void main()
//transform vertex
vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0);
gl_Position = pos;
vary_fragcoord = (pos.xy * 0.5 + 0.5)*screen_res;
vec4 tex = vec4(texcoord0,0,1);
tex.w = 1.0;
vertex_color = diffuse_color;
}

View File

@ -26,7 +26,9 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
//class 1 -- no shadow, SSAO only
@ -37,8 +39,6 @@ uniform sampler2D noiseMap;
// Inputs
uniform mat4 shadow_matrix[6];
uniform vec4 shadow_clip;
uniform float ssao_radius;
uniform float ssao_max_radius;
uniform float ssao_factor;
@ -49,9 +49,6 @@ VARYING vec2 vary_fragcoord;
uniform mat4 inv_proj;
uniform vec2 screen_res;
uniform float shadow_bias;
uniform float shadow_offset;
vec4 getPosition(vec2 pos_screen)
{
float depth = texture2DRect(depthMap, pos_screen.xy).r;
@ -128,8 +125,8 @@ void main()
vec3 norm = texture2DRect(normalMap, pos_screen).xyz;
norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm
gl_FragColor[0] = 1.0;
gl_FragColor[1] = calcAmbientOcclusion(pos, norm);
gl_FragColor[2] = 1.0;
gl_FragColor[3] = 1.0;
frag_color[0] = 1.0;
frag_color[1] = calcAmbientOcclusion(pos, norm);
frag_color[2] = 1.0;
frag_color[3] = 1.0;
}

View File

@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragData[3];
out vec4 frag_data[3];
#else
#define frag_data gl_FragData
#endif
uniform sampler2D detail_0;
@ -51,9 +53,9 @@ void main()
float alphaFinal = texture2D(alpha_ramp, vary_texcoord1.zw).a;
vec4 outColor = mix( mix(color3, color2, alpha2), mix(color1, color0, alpha1), alphaFinal );
gl_FragData[0] = vec4(outColor.rgb, 0.0);
gl_FragData[1] = vec4(0,0,0,0);
frag_data[0] = vec4(outColor.rgb, 0.0);
frag_data[1] = vec4(0,0,0,0);
vec3 nvn = normalize(vary_normal);
gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
frag_data[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
}

View File

@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragData[3];
out vec4 frag_data[3];
#else
#define frag_data gl_FragData
#endif
uniform sampler2D diffuseMap;
@ -43,8 +45,8 @@ void main()
discard;
}
gl_FragData[0] = vec4(vertex_color.rgb*col.rgb, 0.0);
gl_FragData[1] = vec4(0,0,0,0);
frag_data[0] = vec4(vertex_color.rgb*col.rgb, 0.0);
frag_data[1] = vec4(0,0,0,0);
vec3 nvn = normalize(vary_normal);
gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
frag_data[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
}

View File

@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform float minimum_alpha;
@ -43,7 +45,7 @@ void main()
discard;
}
gl_FragColor = vec4(1,1,1,1);
frag_color = vec4(1,1,1,1);
gl_FragDepth = max(post_pos.z/post_pos.w*0.5+0.5, 0.0);
}

View File

@ -26,7 +26,9 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragData[3];
out vec4 frag_data[3];
#else
#define frag_data gl_FragData
#endif
vec3 scaleSoftClip(vec3 inColor);
@ -157,7 +159,7 @@ void main()
//wavef = normalize(wavef);
vec3 screenspacewavef = (norm_mat*vec4(wavef, 1.0)).xyz;
gl_FragData[0] = vec4(color.rgb, 0.5); // diffuse
gl_FragData[1] = vec4(0.5,0.5,0.5, 0.95); // speccolor*spec, spec
gl_FragData[2] = vec4(screenspacewavef.xy*0.5+0.5, screenspacewavef.z, screenspacewavef.z*0.5); // normalxyz, displace
frag_data[0] = vec4(color.rgb, 0.5); // diffuse
frag_data[1] = vec4(0.5,0.5,0.5, 0.95); // speccolor*spec, spec
frag_data[2] = vec4(screenspacewavef.xy*0.5+0.5, screenspacewavef.z, screenspacewavef.z*0.5); // normalxyz, displace
}

View File

@ -26,7 +26,9 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2DRect diffuseMap;
@ -46,7 +48,7 @@ void main()
float lum = smoothstep(minLuminance, minLuminance+1.0, dot(col.rgb, lumWeights ) );
float warmth = smoothstep(minLuminance, minLuminance+1.0, max(col.r * warmthWeights.r, max(col.g * warmthWeights.g, col.b * warmthWeights.b)) );
gl_FragColor.rgb = col.rgb;
gl_FragColor.a = max(col.a, mix(lum, warmth, warmthAmount) * maxExtractAlpha);
frag_color.rgb = col.rgb;
frag_color.a = max(col.a, mix(lum, warmth, warmthAmount) * maxExtractAlpha);
}

View File

@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2D diffuseMap;
@ -54,5 +56,5 @@ void main()
col += kern[6] * texture2D(diffuseMap, vary_texcoord2.zw);
col += kern[7] * texture2D(diffuseMap, vary_texcoord3.zw);
gl_FragColor = vec4(col.rgb * glowStrength, col.a);
frag_color = vec4(col.rgb * glowStrength, col.a);
}

View File

@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
VARYING vec4 vertex_color;
@ -59,6 +61,6 @@ void main()
/// Add WL Components
outColor.rgb = atmosLighting(outColor.rgb * vertex_color.rgb);
gl_FragColor = vec4(scaleSoftClip(outColor.rgb), 1.0);
frag_color = vec4(scaleSoftClip(outColor.rgb), 1.0);
}

View File

@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
VARYING vec4 vertex_color;
@ -60,6 +62,6 @@ void main()
outColor.rgb = atmosLighting(outColor.rgb * vertex_color.rgb);
outColor = applyWaterFog(outColor);
gl_FragColor = outColor;
frag_color = outColor;
}

View File

@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2D diffuseMap;
@ -106,5 +108,5 @@ void main()
vec4 fb = texture2D(screenTex, distort);
gl_FragColor = applyWaterFog(fb,view.xyz);
frag_color = applyWaterFog(fb,view.xyz);
}

View File

@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
vec3 scaleSoftClip(vec3 inColor);
@ -135,5 +137,5 @@ void main()
color.rgb = scaleSoftClip(color.rgb);
color.a = spec * sunAngle2;
gl_FragColor = color;
frag_color = color;
}

View File

@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2D diffuseMap;
@ -42,5 +44,5 @@ void main()
discard;
}
gl_FragColor = col;
frag_color = col;
}

View File

@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2D diffuseMap;
@ -38,5 +40,5 @@ void main()
{
vec4 color = vertex_color*texture2D(diffuseMap, vary_texcoord0.xy);
color.a *= custom_alpha;
gl_FragColor = color;
frag_color = color;
}

View File

@ -24,12 +24,14 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform vec4 color;
void main()
{
gl_FragColor = color;
frag_color = color;
}

View File

@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
#extension GL_ARB_texture_rectangle : enable
@ -37,6 +39,6 @@ VARYING vec2 vary_texcoord1;
void main()
{
gl_FragColor = texture2D(glowMap, vary_texcoord0.xy) +
frag_color = texture2D(glowMap, vary_texcoord0.xy) +
texture2DRect(screenMap, vary_texcoord1.xy);
}

View File

@ -26,7 +26,9 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2DRect diffuseRect;
@ -38,5 +40,5 @@ void main()
{
vec3 col = texture2DRect(diffuseRect, vary_tc*screen_res).rgb;
gl_FragColor = vec4(col.rgb, dot(col.rgb, vec3(0.299, 0.587, 0.144)));
frag_color = vec4(col.rgb, dot(col.rgb, vec3(0.299, 0.587, 0.144)));
}

View File

@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform vec4 color;
@ -34,5 +36,5 @@ VARYING vec2 vary_texcoord0;
void main()
{
gl_FragColor = color*texture2D(diffuseMap, vary_texcoord0.xy);
frag_color = color*texture2D(diffuseMap, vary_texcoord0.xy);
}

View File

@ -24,10 +24,12 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
void main()
{
gl_FragColor = vec4(1,1,1,1);
frag_color = vec4(1,1,1,1);
}

View File

@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2D tex0;
@ -33,5 +35,5 @@ VARYING vec2 vary_texcoord0;
void main()
{
gl_FragColor = texture2D(tex0, vary_texcoord0.xy);
frag_color = texture2D(tex0, vary_texcoord0.xy);
}

View File

@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2D tex0;
@ -36,5 +38,5 @@ void main()
{
float alpha = texture2D(tex0, vary_texcoord0.xy).a * vertex_color.a;
gl_FragColor = vec4(vertex_color.rgb, alpha);
frag_color = vec4(vertex_color.rgb, alpha);
}

View File

@ -26,7 +26,9 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2DRect screenMap;
@ -36,5 +38,5 @@ VARYING vec2 vary_texcoord0;
void main()
{
gl_FragColor = texture2DRect(screenMap, vary_texcoord0.xy) * vertex_color;
frag_color = texture2DRect(screenMap, vary_texcoord0.xy) * vertex_color;
}

View File

@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2D tex0;
@ -35,5 +37,5 @@ VARYING vec2 vary_texcoord1;
void main()
{
gl_FragColor = texture2D(tex0, vary_texcoord0.xy)+texture2D(tex1, vary_texcoord1.xy);
frag_color = texture2D(tex0, vary_texcoord0.xy)+texture2D(tex1, vary_texcoord1.xy);
}

View File

@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2D diffuseMap;
@ -34,5 +36,5 @@ VARYING vec4 vertex_color;
void main()
{
gl_FragColor = vertex_color*texture2D(diffuseMap, vary_texcoord0.xy);
frag_color = vertex_color*texture2D(diffuseMap, vary_texcoord0.xy);
}

View File

@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform float minimum_alpha;
@ -48,6 +50,6 @@ void default_lighting()
color.rgb = scaleSoftClip(color.rgb);
gl_FragColor = color;
frag_color = color;
}

View File

@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform float minimum_alpha;
@ -50,6 +52,6 @@ void default_lighting()
color.rgb = scaleSoftClip(color.rgb);
gl_FragColor = color;
frag_color = color;
}

View File

@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
VARYING vec4 vertex_color;
@ -41,6 +43,6 @@ void default_lighting()
color.rgb = scaleSoftClip(color.rgb);
gl_FragColor = color;
frag_color = color;
}

View File

@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform float minimum_alpha;
@ -48,6 +50,6 @@ void fullbright_lighting()
color.rgb = fullbrightScaleSoftClip(color.rgb);
gl_FragColor = color;
frag_color = color;
}

View File

@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
VARYING vec4 vertex_color;
@ -41,6 +43,6 @@ void fullbright_lighting()
color.rgb = fullbrightScaleSoftClip(color.rgb);
gl_FragColor = color;
frag_color = color;
}

View File

@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform float minimum_alpha;
@ -50,6 +52,6 @@ void fullbright_lighting()
color.rgb = fullbrightScaleSoftClip(color.rgb);
gl_FragColor = color;
frag_color = color;
}

View File

@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
VARYING vec4 vertex_color;
@ -43,6 +45,6 @@ void fullbright_lighting()
color.rgb = fullbrightScaleSoftClip(color.rgb);
gl_FragColor = color;
frag_color = color;
}

View File

@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
VARYING vec4 vertex_color;
@ -50,6 +52,6 @@ void fullbright_shiny_lighting()
color.a = max(color.a, vertex_color.a);
gl_FragColor = color;
frag_color = color;
}

View File

@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
VARYING vec4 vertex_color;
@ -51,6 +53,6 @@ void fullbright_shiny_lighting()
color.a = max(color.a, vertex_color.a);
gl_FragColor = color;
frag_color = color;
}

View File

@ -23,7 +23,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
VARYING vec4 vertex_color;
@ -48,6 +50,6 @@ void fullbright_shiny_lighting_water()
color.rgb = fullbrightScaleSoftClip(color.rgb);
color.a = max(color.a, vertex_color.a);
gl_FragColor = applyWaterFog(color);
frag_color = applyWaterFog(color);
}

View File

@ -23,7 +23,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
VARYING vec4 vertex_color;
@ -49,6 +51,6 @@ void fullbright_shiny_lighting_water()
color.rgb = fullbrightScaleSoftClip(color.rgb);
color.a = max(color.a, vertex_color.a);
gl_FragColor = applyWaterFog(color);
frag_color = applyWaterFog(color);
}

View File

@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform float minimum_alpha;
@ -48,6 +50,6 @@ void fullbright_lighting_water()
color.rgb = fullbrightAtmosTransport(color.rgb);
gl_FragColor = applyWaterFog(color);
frag_color = applyWaterFog(color);
}

View File

@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
VARYING vec4 vertex_color;
@ -41,6 +43,6 @@ void fullbright_lighting_water()
color.rgb = fullbrightAtmosTransport(color.rgb);
gl_FragColor = applyWaterFog(color);
frag_color = applyWaterFog(color);
}

View File

@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform float minimum_alpha;
@ -48,6 +50,6 @@ void fullbright_lighting_water()
color.rgb = fullbrightAtmosTransport(color.rgb);
gl_FragColor = applyWaterFog(color);
frag_color = applyWaterFog(color);
}

View File

@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
VARYING vec4 vertex_color;
@ -41,6 +43,6 @@ void fullbright_lighting_water()
color.rgb = fullbrightAtmosTransport(color.rgb);
gl_FragColor = applyWaterFog(color);
frag_color = applyWaterFog(color);
}

View File

@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
VARYING vec4 vertex_color;
@ -43,6 +45,6 @@ void default_lighting()
color.rgb = scaleSoftClip(color.rgb);
gl_FragColor = color;
frag_color = color;
}

View File

@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
VARYING vec4 vertex_color;
@ -49,6 +51,6 @@ void shiny_lighting()
color.rgb = scaleSoftClip(color.rgb);
color.a = max(color.a, vertex_color.a);
gl_FragColor = color;
frag_color = color;
}

View File

@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
VARYING vec4 vertex_color;
@ -50,6 +52,6 @@ void shiny_lighting()
color.rgb = scaleSoftClip(color.rgb);
color.a = max(color.a, vertex_color.a);
gl_FragColor = color;
frag_color = color;
}

View File

@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
VARYING vec4 vertex_color;
@ -46,6 +48,6 @@ void shiny_lighting_water()
color.rgb = atmosLighting(color.rgb);
color.a = max(color.a, vertex_color.a);
gl_FragColor = applyWaterFog(color);
frag_color = applyWaterFog(color);
}

View File

@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
VARYING vec4 vertex_color;
@ -47,6 +49,6 @@ void shiny_lighting_water()
color.rgb = atmosLighting(color.rgb);
color.a = max(color.a, vertex_color.a);
gl_FragColor = applyWaterFog(color);
frag_color = applyWaterFog(color);
}

View File

@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform float minimum_alpha;
@ -46,6 +48,6 @@ void default_lighting_water()
color.rgb = atmosLighting(color.rgb);
gl_FragColor = applyWaterFog(color);
frag_color = applyWaterFog(color);
}

View File

@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform float minimum_alpha;
@ -50,6 +52,6 @@ void default_lighting_water()
color = applyWaterFog(color);
gl_FragColor = color;
frag_color = color;
}

View File

@ -24,8 +24,10 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
#endif
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
VARYING vec4 vertex_color;
VARYING vec2 vary_texcoord0;
@ -39,6 +41,6 @@ void default_lighting_water()
color.rgb = atmosLighting(color.rgb);
gl_FragColor = applyWaterFog(color);
frag_color = applyWaterFog(color);
}

View File

@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
VARYING vec4 vertex_color;
@ -41,6 +43,6 @@ void default_lighting_water()
color.rgb = atmosLighting(color.rgb);
gl_FragColor = applyWaterFog(color);
frag_color = applyWaterFog(color);
}

Some files were not shown because too many files have changed in this diff Show More