Catching up with Lindies part 2
This commit is contained in:
@@ -1575,7 +1575,7 @@ BOOL LLBVHLoader::serialize(LLDataPacker& dp)
|
||||
constraint_it++)
|
||||
{
|
||||
U8 byte = constraint_it->mChainLength;
|
||||
dp.packU8(byte, "chain_lenght");
|
||||
dp.packU8(byte, "chain_length");
|
||||
|
||||
byte = constraint_it->mConstraintType;
|
||||
dp.packU8(byte, "constraint_type");
|
||||
|
||||
@@ -111,6 +111,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());
|
||||
@@ -309,6 +311,7 @@ PFNGLGETACTIVEUNIFORMARBPROC glGetActiveUniformARB = NULL;
|
||||
PFNGLGETUNIFORMFVARBPROC glGetUniformfvARB = NULL;
|
||||
PFNGLGETUNIFORMIVARBPROC glGetUniformivARB = NULL;
|
||||
PFNGLGETSHADERSOURCEARBPROC glGetShaderSourceARB = NULL;
|
||||
PFNGLVERTEXATTRIBIPOINTERPROC glVertexAttribIPointer = NULL;
|
||||
|
||||
#if LL_WINDOWS
|
||||
PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB = NULL;
|
||||
@@ -458,7 +461,8 @@ LLGLManager::LLGLManager() :
|
||||
mDriverVersionMinor(0),
|
||||
mDriverVersionRelease(0),
|
||||
mGLVersion(1.0f),
|
||||
|
||||
mGLSLVersionMajor(0),
|
||||
mGLSLVersionMinor(0),
|
||||
mVRAM(0),
|
||||
mGLMaxVertexRange(0),
|
||||
mGLMaxIndexRange(0)
|
||||
@@ -569,6 +573,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 ")
|
||||
@@ -1292,6 +1310,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");
|
||||
@@ -2082,6 +2101,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;
|
||||
|
||||
@@ -145,6 +145,8 @@ public:
|
||||
S32 mDriverVersionMinor;
|
||||
S32 mDriverVersionRelease;
|
||||
F32 mGLVersion; // e.g = 1.4
|
||||
S32 mGLSLVersionMajor;
|
||||
S32 mGLSLVersionMinor;
|
||||
std::string mDriverVersionVendorString;
|
||||
|
||||
S32 mVRAM; // VRAM in MB
|
||||
|
||||
@@ -207,6 +207,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;
|
||||
@@ -466,6 +467,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;
|
||||
@@ -699,6 +701,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;
|
||||
|
||||
@@ -149,12 +149,6 @@ BOOL LLGLSLShader::createShader(vector<string> * attributes,
|
||||
glDeleteObjectARB(mProgramObject);
|
||||
// Create program
|
||||
mProgramObject = glCreateProgramObjectARB();
|
||||
|
||||
static const LLCachedControl<bool> no_texture_indexing("ShyotlUseLegacyTextureBatching",false);
|
||||
if (gGLManager.mGLVersion < 3.1f || no_texture_indexing)
|
||||
{ //force indexed texture channels to 1 if GL version is old (performance improvement for drivers with poor branching shader model support)
|
||||
mFeatures.mIndexedTextureChannels = llmin(mFeatures.mIndexedTextureChannels, 1);
|
||||
}
|
||||
|
||||
//compile new source
|
||||
vector< pair<string,GLenum> >::iterator fileIter = mShaderFiles.begin();
|
||||
@@ -181,8 +175,9 @@ BOOL LLGLSLShader::createShader(vector<string> * attributes,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (gGLManager.mGLVersion < 3.1f || no_texture_indexing)
|
||||
{ //attachShaderFeatures may have set the number of indexed texture channels, so set to 1 again
|
||||
static const LLCachedControl<bool> no_texture_indexing("ShyotlUseLegacyTextureBatching",false);
|
||||
if (gGLManager.mGLVersion < 3.1f || no_texture_indexing)
|
||||
{ //attachShaderFeatures may have set the number of indexed texture channels, so set to 1 again
|
||||
mFeatures.mIndexedTextureChannels = llmin(mFeatures.mIndexedTextureChannels, 1);
|
||||
}
|
||||
|
||||
|
||||
@@ -578,34 +578,45 @@ 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");
|
||||
}
|
||||
else
|
||||
{ //set version to 400
|
||||
@@ -621,13 +632,17 @@ 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 texture2DRect 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"); //Shadow lookups only return a single float.
|
||||
@@ -659,11 +674,11 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
|
||||
.
|
||||
uniform sampler2D texN;
|
||||
|
||||
varying float vary_texture_index;
|
||||
VARYING_FLAT ivec4 vary_texture_index;
|
||||
|
||||
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);
|
||||
@@ -687,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");
|
||||
@@ -716,28 +731,10 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
|
||||
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
|
||||
|
||||
@@ -285,6 +285,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)
|
||||
@@ -1178,7 +1184,7 @@ void LLVertexBuffer::setupVertexArray()
|
||||
1, //TYPE_WEIGHT,
|
||||
4, //TYPE_WEIGHT4,
|
||||
4, //TYPE_CLOTHWEIGHT,
|
||||
1, //TYPE_TEXTURE_INDEX
|
||||
4, //TYPE_TEXTURE_INDEX
|
||||
};
|
||||
|
||||
U32 attrib_type[] =
|
||||
@@ -1195,7 +1201,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[] =
|
||||
@@ -1223,7 +1246,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)
|
||||
{
|
||||
#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
|
||||
{
|
||||
@@ -2204,11 +2241,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)
|
||||
{
|
||||
|
||||
@@ -1207,7 +1207,9 @@ if (WINDOWS)
|
||||
DXGUID_LIBRARY
|
||||
)
|
||||
|
||||
# see EXP-1765 - theory is opengl32.lib needs to be included before gdi32.lib (windows libs)
|
||||
set(viewer_LIBRARIES
|
||||
opengl32
|
||||
advapi32
|
||||
comdlg32
|
||||
${DINPUT_LIBRARY}
|
||||
@@ -1218,7 +1220,6 @@ if (WINDOWS)
|
||||
odbccp32
|
||||
ole32
|
||||
oleaut32
|
||||
opengl32
|
||||
shell32
|
||||
user32
|
||||
Vfw32
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
@@ -69,6 +71,6 @@ void main()
|
||||
|
||||
color.rgb += diff.rgb * vary_pointlight_col.rgb;
|
||||
|
||||
gl_FragColor = color;
|
||||
frag_color = color;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
@@ -81,9 +83,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;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
@@ -79,6 +81,6 @@ void main()
|
||||
|
||||
color.rgb += diff.rgb * vary_pointlight_col.rgb;
|
||||
|
||||
gl_FragColor = color;
|
||||
frag_color = color;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,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 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,vertex_color.a * texture2D(diffuseMap, vary_texcoord0.xy).a);
|
||||
frag_color = vec4(1,1,1,1);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
@@ -73,5 +75,5 @@ void main()
|
||||
diff = mix(diff, col*0.25, a);
|
||||
}
|
||||
|
||||
gl_FragColor = mix(diff, dof, a);
|
||||
frag_color = mix(diff, dof, a);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
/**
|
||||
* @file giV.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;
|
||||
ATTRIBUTE vec2 texcoord0;
|
||||
|
||||
VARYING vec4 vertex_color;
|
||||
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;
|
||||
|
||||
vary_fragcoord = (pos.xy * 0.5 + 0.5)*screen_res;
|
||||
vec4 tex = vec4(texcoord0,0,1);
|
||||
tex.w = 1.0;
|
||||
|
||||
vertex_color = diffuse_color;
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
/**
|
||||
* @file postgiV.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;
|
||||
|
||||
|
||||
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;
|
||||
vary_fragcoord = (pos.xy*0.5+0.5)*screen_res;
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
@@ -324,7 +326,7 @@ void main()
|
||||
col = diffuse.rgb;
|
||||
}
|
||||
|
||||
gl_FragColor.rgb = col;
|
||||
frag_color.rgb = col;
|
||||
|
||||
gl_FragColor.a = bloom;
|
||||
frag_color.a = bloom;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
@@ -128,8 +130,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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
@@ -51,5 +53,5 @@ void main()
|
||||
col += kern.y * texture2D(diffuseMap, vary_texcoord2.zw);
|
||||
col += kern.x * texture2D(diffuseMap, vary_texcoord3.zw);
|
||||
|
||||
gl_FragColor = vec4(col.rgb * glowStrength, col.a);
|
||||
frag_color = vec4(col.rgb * glowStrength, col.a);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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)));
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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 texture0;
|
||||
@@ -38,5 +40,5 @@ void main()
|
||||
float tex0 = texture2D(texture0, vary_texcoord0.xy).a;
|
||||
float tex1 = texture2D(texture1, vary_texcoord1.xy).a;
|
||||
|
||||
gl_FragColor = vec4(tex0+(1.0-tex1)-0.5);
|
||||
frag_color = vec4(tex0+(1.0-tex1)-0.5);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
@@ -42,5 +44,5 @@ void main()
|
||||
discard;
|
||||
}
|
||||
|
||||
gl_FragColor = color;
|
||||
frag_color = color;
|
||||
}
|
||||
|
||||
@@ -23,9 +23,9 @@
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
ATTRIBUTE float texture_index;
|
||||
ATTRIBUTE ivec4 texture_index;
|
||||
|
||||
VARYING float vary_texture_index;
|
||||
VARYING_FLAT ivec4 vary_texture_index;
|
||||
|
||||
void passTextureIndex()
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
@@ -125,6 +127,6 @@ void main()
|
||||
|
||||
color.rgb += diff.rgb * vary_pointlight_col.rgb;
|
||||
|
||||
gl_FragColor = color;
|
||||
frag_color = color;
|
||||
}
|
||||
|
||||
|
||||
@@ -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 sampler2DRectShadow shadowMap0;
|
||||
@@ -138,6 +140,6 @@ void main()
|
||||
|
||||
color.rgb += diff.rgb * vary_pointlight_col.rgb;
|
||||
|
||||
gl_FragColor = color;
|
||||
frag_color = color;
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user