Do not undefine builtin macros.
This commit is contained in:
parent
bccde0ce34
commit
c4e5a720f7
@ -1,4 +1,4 @@
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
layout(bindless_sampler) uniform sampler2D Albedo;
|
||||
layout(bindless_sampler) uniform sampler2D Detail;
|
||||
layout(bindless_sampler) uniform sampler2D SpecMap;
|
||||
@ -23,7 +23,7 @@ vec3 getLightFactor(vec3 diffuseMatColor, vec3 specularMatColor, float specMapVa
|
||||
void main(void)
|
||||
{
|
||||
vec4 color = texture(Albedo, uv);
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
#ifdef SRGBBindlessFix
|
||||
color.xyz = pow(color.xyz, vec3(2.2));
|
||||
#endif
|
||||
|
@ -1,4 +1,4 @@
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
layout(bindless_sampler) uniform sampler2D Albedo;
|
||||
layout(bindless_sampler) uniform sampler2D dtex;
|
||||
layout(bindless_sampler) uniform sampler2D SpecMap;
|
||||
@ -17,7 +17,7 @@ vec3 getLightFactor(vec3 diffuseMatColor, vec3 specularMatColor, float specMapVa
|
||||
void main(void)
|
||||
{
|
||||
vec4 color = texture(Albedo, uv);
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
#ifdef SRGBBindlessFix
|
||||
color.xyz = pow(color.xyz, vec3(2.2));
|
||||
#endif
|
||||
|
@ -1,10 +1,10 @@
|
||||
#ifndef GL_ARB_bindless_texture
|
||||
#ifndef Use_Bindless_Texture
|
||||
uniform sampler2D Albedo;
|
||||
uniform sampler2D Detail;
|
||||
uniform sampler2D SpecMap;
|
||||
#endif
|
||||
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
flat in sampler2D handle;
|
||||
flat in sampler2D secondhandle;
|
||||
flat in sampler2D thirdhandle;
|
||||
@ -17,7 +17,7 @@ vec3 getLightFactor(vec3 diffuseMatColor, vec3 specularMatColor, float specMapVa
|
||||
|
||||
void main(void)
|
||||
{
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
vec4 color = texture(handle, uv);
|
||||
float specmap = texture(secondhandle, uv).g;
|
||||
#ifdef SRGBBindlessFix
|
||||
|
@ -9,7 +9,7 @@ layout(location = 3) in vec2 Texcoord;
|
||||
layout(location = 7) in vec3 Origin;
|
||||
layout(location = 8) in vec3 Orientation;
|
||||
layout(location = 9) in vec3 Scale;
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
layout(location = 10) in sampler2D Handle;
|
||||
layout(location = 11) in sampler2D SecondHandle;
|
||||
#endif
|
||||
@ -27,7 +27,7 @@ in vec3 Scale;
|
||||
|
||||
out vec3 nor;
|
||||
out vec2 uv;
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
flat out sampler2D handle;
|
||||
flat out sampler2D secondhandle;
|
||||
#endif
|
||||
@ -42,7 +42,7 @@ void main()
|
||||
gl_Position = ProjectionViewMatrix * ModelMatrix * vec4(Position, 1.);
|
||||
nor = (TransposeInverseModelView * vec4(Normal, 0.)).xyz;
|
||||
uv = Texcoord;
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
handle = Handle;
|
||||
secondhandle = SecondHandle;
|
||||
#endif
|
||||
|
@ -1,4 +1,4 @@
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
layout(bindless_sampler) uniform sampler2D dtex;
|
||||
#else
|
||||
uniform sampler2D Albedo;
|
||||
@ -6,7 +6,7 @@ uniform sampler2D SpecMap;
|
||||
uniform sampler2D dtex;
|
||||
#endif
|
||||
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
flat in sampler2D handle;
|
||||
flat in sampler2D secondhandle;
|
||||
#endif
|
||||
@ -18,7 +18,7 @@ vec3 getLightFactor(vec3 diffuseMatColor, vec3 specularMatColor, float specMapVa
|
||||
|
||||
void main(void)
|
||||
{
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
vec4 color = texture(handle, uv);
|
||||
float specmap = texture(secondhandle, uv).g;
|
||||
#ifdef SRGBBindlessFix
|
||||
|
@ -1,9 +1,9 @@
|
||||
#ifndef GL_ARB_bindless_texture
|
||||
#ifndef Use_Bindless_Texture
|
||||
uniform sampler2D normalMap;
|
||||
uniform sampler2D glossMap;
|
||||
#endif
|
||||
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
flat in sampler2D secondhandle;
|
||||
flat in sampler2D thirdhandle;
|
||||
#endif
|
||||
@ -17,7 +17,7 @@ vec2 EncodeNormal(vec3 n);
|
||||
void main()
|
||||
{
|
||||
// normal in Tangent Space
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
vec3 TS_normal = 2.0 * texture(thirdhandle, uv).rgb - 1.0;
|
||||
float gloss = texture(secondhandle, uv).x;
|
||||
#else
|
||||
|
@ -10,7 +10,7 @@ layout(location = 6) in vec3 Bitangent;
|
||||
layout(location = 7) in vec3 Origin;
|
||||
layout(location = 8) in vec3 Orientation;
|
||||
layout(location = 9) in vec3 Scale;
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
layout(location = 10) in sampler2D Handle;
|
||||
layout(location = 11) in sampler2D SecondHandle;
|
||||
layout(location = 13) in sampler2D ThirdHandle;
|
||||
@ -36,7 +36,7 @@ out vec3 bitangent;
|
||||
out vec2 uv;
|
||||
out vec2 uv_bis;
|
||||
out vec4 color;
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
flat out sampler2D handle;
|
||||
flat out sampler2D secondhandle;
|
||||
flat out sampler2D thirdhandle;
|
||||
@ -56,7 +56,7 @@ void main(void)
|
||||
uv = Texcoord;
|
||||
uv_bis = SecondTexcoord;
|
||||
color = Color.zyxw;
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
handle = Handle;
|
||||
secondhandle = SecondHandle;
|
||||
thirdhandle = ThirdHandle;
|
||||
|
@ -1,8 +1,8 @@
|
||||
#ifndef GL_ARB_bindless_texture
|
||||
#ifndef Use_Bindless_Texture
|
||||
uniform sampler2D glosstex;
|
||||
#endif
|
||||
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
flat in sampler2D secondhandle;
|
||||
#endif
|
||||
in vec3 nor;
|
||||
@ -13,7 +13,7 @@ vec2 EncodeNormal(vec3 n);
|
||||
|
||||
void main(void)
|
||||
{
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
float glossmap = texture(secondhandle, uv).x;
|
||||
#else
|
||||
float glossmap = texture(glosstex, uv).x;
|
||||
|
@ -1,9 +1,9 @@
|
||||
#ifndef GL_ARB_bindless_texture
|
||||
#ifndef Use_Bindless_Texture
|
||||
uniform sampler2D Albedo;
|
||||
uniform sampler2D SpecMap;
|
||||
#endif
|
||||
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
flat in sampler2D handle;
|
||||
flat in sampler2D secondhandle;
|
||||
#endif
|
||||
@ -15,7 +15,7 @@ vec3 getLightFactor(vec3 diffuseMatColor, vec3 specularMatColor, float specMapVa
|
||||
|
||||
void main(void)
|
||||
{
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
vec4 col = texture(handle, uv);
|
||||
float specmap = texture(secondhandle, uv).g;
|
||||
float emitmap = texture(secondhandle, uv).b;
|
||||
|
@ -1,8 +1,8 @@
|
||||
#ifndef GL_ARB_bindless_texture
|
||||
#ifndef Use_Bindless_Texture
|
||||
uniform sampler2D tex;
|
||||
#endif
|
||||
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
flat in sampler2D handle;
|
||||
#endif
|
||||
|
||||
@ -12,7 +12,7 @@ out vec4 FragColor;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
vec4 col = texture(handle, uv);
|
||||
#ifdef SRGBBindlessFix
|
||||
col.xyz = pow(col.xyz, vec3(2.2));
|
||||
|
@ -1,10 +1,10 @@
|
||||
// See http://www.ozone3d.net/tutorials/glsl_texturing_p04.php for ref
|
||||
|
||||
#ifndef GL_ARB_bindless_texture
|
||||
#ifndef Use_Bindless_Texture
|
||||
uniform sampler2D tex;
|
||||
#endif
|
||||
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
flat in sampler2D handle;
|
||||
#endif
|
||||
in vec3 nor;
|
||||
@ -21,7 +21,7 @@ void main() {
|
||||
|
||||
float m = 2.0 * sqrt(r.x * r.x + r.y * r.y + (r.z + 1.0) * (r.z + 1.0));
|
||||
r.y = - r.y;
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
vec4 detail0 = texture(handle, r.xy / m + .5);
|
||||
#ifdef SRGBBindlessFix
|
||||
detail0.xyz = pow(detail0.xyz, vec3(2.2));
|
||||
|
@ -1,9 +1,9 @@
|
||||
#ifndef GL_ARB_bindless_texture
|
||||
#ifndef Use_Bindless_Texture
|
||||
uniform sampler2D tex;
|
||||
uniform sampler2D glosstex;
|
||||
#endif
|
||||
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
flat in sampler2D handle;
|
||||
flat in sampler2D secondhandle;
|
||||
#endif
|
||||
@ -14,7 +14,7 @@ out vec3 EncodedNormal;
|
||||
vec2 EncodeNormal(vec3 n);
|
||||
|
||||
void main() {
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
vec4 col = texture(handle, uv);
|
||||
float glossmap = texture(secondhandle, uv).x;
|
||||
#else
|
||||
|
@ -1,9 +1,9 @@
|
||||
#ifndef GL_ARB_bindless_texture
|
||||
#ifndef Use_Bindless_Texture
|
||||
uniform sampler2D Albedo;
|
||||
uniform sampler2D SpecMap;
|
||||
#endif
|
||||
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
flat in sampler2D handle;
|
||||
flat in sampler2D secondhandle;
|
||||
#endif
|
||||
@ -15,7 +15,7 @@ vec3 getLightFactor(vec3 diffuseMatColor, vec3 specularMatColor, float specMapVa
|
||||
|
||||
void main(void)
|
||||
{
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
vec4 col = texture(handle, uv);
|
||||
float specmap = texture(secondhandle, uv).g;
|
||||
#ifdef SRGBBindlessFix
|
||||
|
@ -1,11 +1,11 @@
|
||||
#ifndef GL_ARB_bindless_texture
|
||||
#ifndef Use_Bindless_Texture
|
||||
uniform sampler2D tex;
|
||||
#endif
|
||||
|
||||
in vec2 uv;
|
||||
in vec3 nor;
|
||||
in vec4 color;
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
flat in uvec2 handle;
|
||||
#endif
|
||||
layout (location = 0) out vec3 RSMColor;
|
||||
@ -13,7 +13,7 @@ layout (location = 1) out vec3 RSMNormals;
|
||||
|
||||
void main()
|
||||
{
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
vec4 col = texture(sampler2D(handle), uv);
|
||||
#ifdef SRGBBindlessFix
|
||||
col.xyz = pow(col.xyz, vec3(2.2));
|
||||
|
@ -8,7 +8,7 @@ layout(location = 4) in vec2 SecondTexcoord;
|
||||
layout(location = 7) in vec3 Origin;
|
||||
layout(location = 8) in vec3 Orientation;
|
||||
layout(location = 9) in vec3 Scale;
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
layout(location = 10) in uvec2 Handle;
|
||||
#endif
|
||||
|
||||
@ -16,7 +16,7 @@ out vec3 nor;
|
||||
out vec2 uv;
|
||||
out vec2 uv_bis;
|
||||
out vec4 color;
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
flat out uvec2 handle;
|
||||
#endif
|
||||
|
||||
@ -33,7 +33,7 @@ void main(void)
|
||||
nor = (TransposeInverseModel * vec4(Normal, 0.)).xyz;
|
||||
uv = Texcoord;
|
||||
color = Color.zyxw;
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
handle = Handle;
|
||||
#endif
|
||||
}
|
||||
|
@ -1,21 +1,21 @@
|
||||
layout(triangles) in;
|
||||
layout(triangle_strip, max_vertices=3) out;
|
||||
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
flat in uvec2 hdle[3];
|
||||
#endif
|
||||
in vec2 tc[3];
|
||||
in int layerId[3];
|
||||
|
||||
out vec2 uv;
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
out flat uvec2 handle;
|
||||
#endif
|
||||
|
||||
void main(void)
|
||||
{
|
||||
gl_Layer = layerId[0];
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
handle = hdle[0];
|
||||
#endif
|
||||
for(int i=0; i<3; i++)
|
||||
|
@ -1,8 +1,8 @@
|
||||
#ifndef GL_ARB_bindless_texture
|
||||
#ifndef Use_Bindless_Texture
|
||||
uniform sampler2D tex;
|
||||
#endif
|
||||
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
flat in uvec2 handle;
|
||||
#endif
|
||||
in vec2 uv;
|
||||
@ -11,7 +11,7 @@ out vec4 FragColor;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
vec4 col = texture(sampler2D(handle), uv);
|
||||
#else
|
||||
vec4 col = texture(tex, uv);
|
||||
|
@ -9,7 +9,7 @@ layout(location = 3) in vec2 Texcoord;
|
||||
layout(location = 7) in vec3 Origin;
|
||||
layout(location = 8) in vec3 Orientation;
|
||||
layout(location = 9) in vec3 Scale;
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
layout(location = 10) in uvec2 Handle;
|
||||
#endif
|
||||
|
||||
@ -25,13 +25,13 @@ in vec3 Scale;
|
||||
|
||||
#ifdef VSLayer
|
||||
out vec2 uv;
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
flat out uvec2 handle;
|
||||
#endif
|
||||
#else
|
||||
out vec2 tc;
|
||||
out int layerId;
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
flat out uvec2 hdle;
|
||||
#endif
|
||||
#endif
|
||||
@ -46,14 +46,14 @@ void main(void)
|
||||
gl_Layer = layer;
|
||||
gl_Position = ShadowViewProjMatrixes[gl_Layer] * ModelMatrix * vec4(Position + windDir * Color.r, 1.);
|
||||
uv = Texcoord;
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
handle = Handle;
|
||||
#endif
|
||||
#else
|
||||
layerId = layer;
|
||||
gl_Position = ShadowViewProjMatrixes[layerId] * ModelMatrix * vec4(Position + windDir * Color.r, 1.);
|
||||
tc = Texcoord;
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
hdle = Handle;
|
||||
#endif
|
||||
#endif
|
||||
|
@ -7,7 +7,7 @@ layout(location = 3) in vec2 Texcoord;
|
||||
layout(location = 7) in vec3 Origin;
|
||||
layout(location = 8) in vec3 Orientation;
|
||||
layout(location = 9) in vec3 Scale;
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
layout(location = 10) in uvec2 Handle;
|
||||
#endif
|
||||
|
||||
@ -22,13 +22,13 @@ in vec3 Scale;
|
||||
|
||||
#ifdef VSLayer
|
||||
out vec2 uv;
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
flat out uvec2 handle;
|
||||
#endif
|
||||
#else
|
||||
out vec2 tc;
|
||||
out int layerId;
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
flat out uvec2 hdle;
|
||||
#endif
|
||||
#endif
|
||||
@ -43,14 +43,14 @@ void main(void)
|
||||
gl_Layer = layer;
|
||||
gl_Position = ShadowViewProjMatrixes[gl_Layer] * ModelMatrix * vec4(Position, 1.);
|
||||
uv = Texcoord;
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
handle = Handle;
|
||||
#endif
|
||||
#else
|
||||
layerId = layer;
|
||||
gl_Position = ShadowViewProjMatrixes[layerId] * ModelMatrix * vec4(Position, 1.);
|
||||
tc = Texcoord;
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
hdle = Handle;
|
||||
#endif
|
||||
#endif
|
||||
|
@ -1,4 +1,4 @@
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
layout(bindless_sampler) uniform sampler2D normalMap;
|
||||
layout(bindless_sampler) uniform sampler2D DiffuseForAlpha;
|
||||
#else
|
||||
|
@ -1,4 +1,4 @@
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
layout(bindless_sampler) uniform sampler2D tex;
|
||||
#else
|
||||
uniform sampler2D tex;
|
||||
|
@ -1,4 +1,4 @@
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
layout(bindless_sampler) uniform sampler2D Albedo;
|
||||
layout(bindless_sampler) uniform sampler2D SpecMap;
|
||||
#else
|
||||
@ -14,7 +14,7 @@ vec3 getLightFactor(vec3 diffuseMatColor, vec3 specularMatColor, float specMapVa
|
||||
|
||||
void main(void)
|
||||
{
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
vec4 col = texture(Albedo, uv);
|
||||
#ifdef SRGBBindlessFix
|
||||
col.xyz = pow(col.xyz, vec3(2.2));
|
||||
|
@ -1,4 +1,4 @@
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
layout(bindless_sampler) uniform sampler2D tex;
|
||||
#else
|
||||
uniform sampler2D tex;
|
||||
@ -11,7 +11,7 @@ out vec4 FragColor;
|
||||
void main(void)
|
||||
{
|
||||
vec4 col = texture(tex, uv);
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
#ifdef SRGBBindlessFix
|
||||
col.xyz = pow(col.xyz, vec3(2.2));
|
||||
#endif
|
||||
|
@ -1,6 +1,6 @@
|
||||
// See http://www.ozone3d.net/tutorials/glsl_texturing_p04.php for ref
|
||||
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
layout(bindless_sampler) uniform sampler2D tex;
|
||||
#else
|
||||
uniform sampler2D tex;
|
||||
@ -25,7 +25,7 @@ void main() {
|
||||
float m = 2.0 * sqrt(r.x * r.x + r.y * r.y + (r.z + 1.0) * (r.z + 1.0));
|
||||
r.y = - r.y;
|
||||
vec4 detail0 = texture(tex, r.xy / m + .5);
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
#ifdef SRGBBindlessFix
|
||||
detail0.xyz = pow(detail0.xyz, vec3(2.2));
|
||||
#endif
|
||||
|
@ -1,4 +1,4 @@
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
layout(bindless_sampler) uniform sampler2D tex;
|
||||
layout(bindless_sampler) uniform sampler2D glosstex;
|
||||
#else
|
||||
|
@ -1,4 +1,4 @@
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
layout(bindless_sampler) uniform sampler2D Albedo;
|
||||
layout(bindless_sampler) uniform sampler2D SpecMap;
|
||||
#else
|
||||
@ -15,7 +15,7 @@ vec3 getLightFactor(vec3 diffuseMatColor, vec3 specularMatColor, float specMapVa
|
||||
void main(void)
|
||||
{
|
||||
vec4 col = texture(Albedo, uv);
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
#ifdef SRGBBindlessFix
|
||||
col.xyz = pow(col.xyz, vec3(2.2));
|
||||
#endif
|
||||
|
@ -1,4 +1,4 @@
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
layout(bindless_sampler) uniform sampler2D tex;
|
||||
#else
|
||||
uniform sampler2D tex;
|
||||
|
@ -1,4 +1,4 @@
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
layout(bindless_sampler) uniform sampler2D tex_layout;
|
||||
layout(bindless_sampler) uniform sampler2D tex_detail0;
|
||||
layout(bindless_sampler) uniform sampler2D tex_detail1;
|
||||
@ -32,7 +32,7 @@ void main() {
|
||||
vec4 detail2 = texture(tex_detail2, uv);
|
||||
vec4 detail3 = texture(tex_detail3, uv);
|
||||
vec4 detail4 = vec4(0.0);
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
#ifdef SRGBBindlessFix
|
||||
detail0.xyz = pow(detail0.xyz, vec3(2.2));
|
||||
detail1.xyz = pow(detail1.xyz, vec3(2.2));
|
||||
|
@ -1,4 +1,4 @@
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
layout(bindless_sampler) uniform sampler2D tex;
|
||||
#else
|
||||
uniform sampler2D tex;
|
||||
@ -12,7 +12,7 @@ out vec4 FragColor;
|
||||
void main()
|
||||
{
|
||||
vec4 Color = texture(tex, uv);
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
Color.xyz = pow(Color.xyz, vec3(2.2));
|
||||
#endif
|
||||
Color.xyz *= pow(color.xyz, vec3(2.2));
|
||||
|
@ -1,4 +1,4 @@
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
layout(bindless_sampler) uniform sampler2D tex;
|
||||
#else
|
||||
uniform sampler2D tex;
|
||||
@ -20,7 +20,7 @@ out vec4 FragColor;
|
||||
void main()
|
||||
{
|
||||
vec4 diffusecolor = texture(tex, uv);
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
diffusecolor.xyz = pow(diffusecolor.xyz, vec3(2.2));
|
||||
#endif
|
||||
diffusecolor.xyz *= pow(color.xyz, vec3(2.2));
|
||||
|
@ -1,4 +1,4 @@
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
layout(bindless_sampler) uniform sampler2D DiffuseMap;
|
||||
layout(bindless_sampler) uniform sampler2D SpecularMap;
|
||||
layout(bindless_sampler) uniform sampler2D SSAO;
|
||||
|
@ -1,4 +1,4 @@
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
layout(bindless_sampler) uniform sampler2D tex;
|
||||
#else
|
||||
uniform sampler2D tex;
|
||||
@ -20,7 +20,7 @@ out vec4 FragColor;
|
||||
void main()
|
||||
{
|
||||
vec4 diffusecolor = texture(tex, uv);
|
||||
#ifdef GL_ARB_bindless_texture
|
||||
#ifdef Use_Bindless_Texture
|
||||
diffusecolor.xyz = pow(diffusecolor.xyz, vec3(2.2));
|
||||
#endif
|
||||
diffusecolor.xyz *= pow(color.xyz, vec3(2.2));
|
||||
|
@ -150,11 +150,9 @@ GLuint LoadShader(const char * file, unsigned type)
|
||||
if (irr_driver->hasVSLayerExtension())
|
||||
Code += "#extension GL_AMD_vertex_shader_layer : enable\n";
|
||||
if (irr_driver->useAZDO())
|
||||
Code += "#extension GL_ARB_bindless_texture : enable\n";
|
||||
else if (irr_driver->hasARBBindlessTexture())
|
||||
{
|
||||
Code += "#extension GL_ARB_bindless_texture : disable\n";
|
||||
Code += "#undef GL_ARB_bindless_texture\n";
|
||||
Code += "#extension GL_ARB_bindless_texture : enable\n";
|
||||
Code += "#define Use_Bindless_Texture\n";
|
||||
}
|
||||
std::ifstream Stream(file, std::ios::in);
|
||||
Code += "//" + std::string(file) + "\n";
|
||||
|
Loading…
x
Reference in New Issue
Block a user