Added #version string to many shaders. Added a few to-be-implemented shader files

This commit is contained in:
Shyotl
2011-05-18 14:58:57 -05:00
parent 90c0ea63b1
commit 0193173e46
160 changed files with 419 additions and 17 deletions

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
void default_lighting(); void default_lighting();
void main() void main()

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
attribute vec4 weight; //1 attribute vec4 weight; //1
uniform vec4 matrixPalette[45]; uniform vec4 matrixPalette[45];

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
mat4 getSkinnedTransform(); mat4 getSkinnedTransform();
void calcAtmospherics(vec3 inPositionEye); void calcAtmospherics(vec3 inPositionEye);

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
void default_lighting(); void default_lighting();
void main() void main()

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
vec4 calcLightingSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor, vec4 baseCol); vec4 calcLightingSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor, vec4 baseCol);
void calcAtmospherics(vec3 inPositionEye); void calcAtmospherics(vec3 inPositionEye);

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
uniform sampler2D diffuseMap; uniform sampler2D diffuseMap;
void main() void main()

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
mat4 getSkinnedTransform(); mat4 getSkinnedTransform();
void main() void main()

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
#extension GL_ARB_texture_rectangle : enable #extension GL_ARB_texture_rectangle : enable
uniform sampler2D diffuseMap; uniform sampler2D diffuseMap;
@@ -25,7 +27,6 @@ varying vec3 vary_pointlight_col;
uniform mat4 inv_proj; uniform mat4 inv_proj;
vec4 getPosition(vec2 pos_screen) vec4 getPosition(vec2 pos_screen)
{ {
float depth = texture2DRect(depthMap, pos_screen.xy).a; float depth = texture2DRect(depthMap, pos_screen.xy).a;

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
void calcAtmospherics(vec3 inPositionEye); void calcAtmospherics(vec3 inPositionEye);

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
mat4 getSkinnedTransform(); mat4 getSkinnedTransform();
void calcAtmospherics(vec3 inPositionEye); void calcAtmospherics(vec3 inPositionEye);

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
uniform sampler2D diffuseMap; uniform sampler2D diffuseMap;
varying vec3 vary_normal; varying vec3 vary_normal;

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
uniform sampler2D diffuseMap; uniform sampler2D diffuseMap;

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
mat4 getSkinnedTransform(); mat4 getSkinnedTransform();
attribute vec4 weight; attribute vec4 weight;

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
mat4 getSkinnedTransform(); mat4 getSkinnedTransform();
attribute vec4 weight; attribute vec4 weight;

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
#extension GL_ARB_texture_rectangle : enable #extension GL_ARB_texture_rectangle : enable
uniform sampler2DRect depthMap; uniform sampler2DRect depthMap;

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
varying vec2 vary_fragcoord; varying vec2 vary_fragcoord;
uniform vec2 screen_res; uniform vec2 screen_res;

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
uniform sampler2D diffuseMap; uniform sampler2D diffuseMap;
uniform sampler2D bumpMap; uniform sampler2D bumpMap;

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
varying vec3 vary_mat0; varying vec3 vary_mat0;
varying vec3 vary_mat1; varying vec3 vary_mat1;
varying vec3 vary_mat2; varying vec3 vary_mat2;

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
uniform sampler2D diffuseMap; uniform sampler2D diffuseMap;
varying vec3 vary_normal; varying vec3 vary_normal;

View File

@@ -5,6 +5,8 @@
* $/LicenseInfo$ * $/LicenseInfo$
*/ */
#version 120
varying vec3 vary_normal; varying vec3 vary_normal;
void main() void main()

View File

@@ -5,6 +5,8 @@
* $/LicenseInfo$ * $/LicenseInfo$
*/ */
#version 120
#extension GL_ARB_texture_rectangle : enable #extension GL_ARB_texture_rectangle : enable
uniform sampler2D diffuseMap; uniform sampler2D diffuseMap;

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
void calcAtmospherics(vec3 inPositionEye); void calcAtmospherics(vec3 inPositionEye);
vec3 atmosAmbient(vec3 light); vec3 atmosAmbient(vec3 light);

View File

@@ -5,6 +5,8 @@
* $/LicenseInfo$ * $/LicenseInfo$
*/ */
#version 120
#extension GL_ARB_texture_rectangle : enable #extension GL_ARB_texture_rectangle : enable
uniform sampler2DRect depthMap; uniform sampler2DRect depthMap;

View File

@@ -5,6 +5,8 @@
* $/LicenseInfo$ * $/LicenseInfo$
*/ */
#version 120
varying vec2 vary_fragcoord; varying vec2 vary_fragcoord;
uniform vec2 screen_res; uniform vec2 screen_res;

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
uniform sampler2D diffuseMap; uniform sampler2D diffuseMap;
uniform sampler2D normalMap; uniform sampler2D normalMap;
uniform sampler2D specularMap; uniform sampler2D specularMap;
@@ -12,7 +14,7 @@ uniform sampler2D specularMap;
void main() void main()
{ {
vec4 col = texture2D(diffuseMap, gl_TexCoord[0].xy); vec4 col = texture2D(diffuseMap, gl_TexCoord[0].xy);
gl_FragData[0] = vec4(col.rgb, col.a <= 0.5 ? 0.0 : 0.005); gl_FragData[0] = vec4(col.rgb, col.a * 0.005);
gl_FragData[1] = texture2D(specularMap, gl_TexCoord[0].xy); gl_FragData[1] = texture2D(specularMap, gl_TexCoord[0].xy);
gl_FragData[2] = vec4(texture2D(normalMap, gl_TexCoord[0].xy).xyz, 0.0); gl_FragData[2] = vec4(texture2D(normalMap, gl_TexCoord[0].xy).xyz, 0.0);
} }

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
void main() void main()
{ {
//transform vertex //transform vertex

View File

@@ -5,6 +5,8 @@
* $/LicenseInfo$ * $/LicenseInfo$
*/ */
#version 120
uniform sampler2DRect diffuseMap; uniform sampler2DRect diffuseMap;
varying vec2 vary_fragcoord; varying vec2 vary_fragcoord;

View File

@@ -5,6 +5,9 @@
* $/LicenseInfo$ * $/LicenseInfo$
*/ */
#version 120
varying vec2 vary_fragcoord; varying vec2 vary_fragcoord;
uniform vec2 screen_res; uniform vec2 screen_res;

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
#extension GL_ARB_texture_rectangle : enable #extension GL_ARB_texture_rectangle : enable
uniform sampler2DRect depthMap; uniform sampler2DRect depthMap;

View File

@@ -0,0 +1,20 @@
/**
* @file multiPointLightV.glsl
*
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
* $/LicenseInfo$
*/
#version 120
varying vec4 vary_fragcoord;
void main()
{
//transform vertex
vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex;
vary_fragcoord = pos;
gl_Position = pos;
gl_FrontColor = gl_Color;
}

View File

@@ -5,6 +5,8 @@
* $/LicenseInfo$ * $/LicenseInfo$
*/ */
#version 120
#extension GL_ARB_texture_rectangle : enable #extension GL_ARB_texture_rectangle : enable
uniform sampler2DRect diffuseRect; uniform sampler2DRect diffuseRect;

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
varying vec4 vary_light; varying vec4 vary_light;
varying vec4 vary_fragcoord; varying vec4 vary_fragcoord;

View File

@@ -5,6 +5,8 @@
* $/LicenseInfo$ * $/LicenseInfo$
*/ */
#version 120
#extension GL_ARB_texture_rectangle : enable #extension GL_ARB_texture_rectangle : enable
uniform sampler2DRect diffuseRect; uniform sampler2DRect diffuseRect;

View File

@@ -0,0 +1,24 @@
/**
* @file postDeferredF.glsl
*
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
* $/LicenseInfo$
*/
#version 120
#extension GL_ARB_texture_rectangle : enable
uniform sampler2DRect diffuseRect;
uniform sampler2D bloomMap;
uniform vec2 screen_res;
varying vec2 vary_fragcoord;
void main()
{
vec4 diff = texture2DRect(diffuseRect, vary_fragcoord.xy);
vec4 bloom = texture2D(bloomMap, vary_fragcoord.xy/screen_res);
gl_FragColor = diff + bloom;
}

View File

@@ -5,6 +5,8 @@
* $/LicenseInfo$ * $/LicenseInfo$
*/ */
#version 120
varying vec2 vary_fragcoord; varying vec2 vary_fragcoord;
uniform vec2 screen_res; uniform vec2 screen_res;

View File

@@ -5,6 +5,8 @@
* $/LicenseInfo$ * $/LicenseInfo$
*/ */
#version 120
uniform sampler2DRect depthMap; uniform sampler2DRect depthMap;
uniform sampler2DRect normalMap; uniform sampler2DRect normalMap;
uniform sampler2DRect giLightMap; uniform sampler2DRect giLightMap;

View File

@@ -5,6 +5,8 @@
* $/LicenseInfo$ * $/LicenseInfo$
*/ */
#version 120
varying vec2 vary_fragcoord; varying vec2 vary_fragcoord;
uniform vec2 screen_res; uniform vec2 screen_res;

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
uniform sampler2D diffuseMap; uniform sampler2D diffuseMap;
varying vec4 post_pos; varying vec4 post_pos;

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
varying vec4 post_pos; varying vec4 post_pos;
void main() void main()

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
#extension GL_ARB_texture_rectangle : enable #extension GL_ARB_texture_rectangle : enable
uniform sampler2DRect diffuseRect; uniform sampler2DRect diffuseRect;

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
uniform vec2 screen_res; uniform vec2 screen_res;
varying vec4 vary_light; varying vec4 vary_light;

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
//class 1, no shadow, no SSAO, should never be called //class 1, no shadow, no SSAO, should never be called
#extension GL_ARB_texture_rectangle : enable #extension GL_ARB_texture_rectangle : enable

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
#extension GL_ARB_texture_rectangle : enable #extension GL_ARB_texture_rectangle : enable
//class 1 -- no shadow, SSAO only //class 1 -- no shadow, SSAO only
@@ -13,8 +15,6 @@ uniform sampler2DRect depthMap;
uniform sampler2DRect normalMap; uniform sampler2DRect normalMap;
uniform sampler2D noiseMap; uniform sampler2D noiseMap;
uniform sampler2D lightFunc;
// Inputs // Inputs
uniform mat4 shadow_matrix[6]; uniform mat4 shadow_matrix[6];

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
varying vec4 vary_light; varying vec4 vary_light;
varying vec2 vary_fragcoord; varying vec2 vary_fragcoord;

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
uniform sampler2D detail_0; uniform sampler2D detail_0;
uniform sampler2D detail_1; uniform sampler2D detail_1;
uniform sampler2D detail_2; uniform sampler2D detail_2;

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
varying vec3 vary_normal; varying vec3 vary_normal;
vec4 texgen_object(vec4 vpos, vec4 tc, mat4 mat, vec4 tp0, vec4 tp1) vec4 texgen_object(vec4 vpos, vec4 tc, mat4 mat, vec4 tp0, vec4 tp1)

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
uniform sampler2D diffuseMap; uniform sampler2D diffuseMap;
varying vec3 vary_normal; varying vec3 vary_normal;

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
varying vec3 vary_normal; varying vec3 vary_normal;
void main() void main()

View File

@@ -5,7 +5,10 @@
* $License$ * $License$
*/ */
#version 120
#extension GL_ARB_texture_rectangle : enable #extension GL_ARB_texture_rectangle : enable
vec3 scaleSoftClip(vec3 inColor); vec3 scaleSoftClip(vec3 inColor);
vec3 atmosTransport(vec3 inColor); vec3 atmosTransport(vec3 inColor);

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
void calcAtmospherics(vec3 inPositionEye); void calcAtmospherics(vec3 inPositionEye);
uniform vec2 d1; uniform vec2 d1;

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
#extension GL_ARB_texture_rectangle : enable #extension GL_ARB_texture_rectangle : enable
uniform sampler2DRect diffuseMap; uniform sampler2DRect diffuseMap;

View File

@@ -5,6 +5,7 @@
* $License$ * $License$
*/ */
#version 120
void main() void main()
{ {

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
uniform vec2 glowDelta; uniform vec2 glowDelta;
void main() void main()

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
uniform sampler2D detail0; uniform sampler2D detail0;
uniform sampler2D detail1; uniform sampler2D detail1;
uniform sampler2D alphaRamp; uniform sampler2D alphaRamp;

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
vec4 texgen_object(vec4 vpos, vec4 tc, mat4 mat, vec4 tp0, vec4 tp1) vec4 texgen_object(vec4 vpos, vec4 tc, mat4 mat, vec4 tp0, vec4 tp1)

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
// this class1 shader is just a copy of terrainF // this class1 shader is just a copy of terrainF
uniform sampler2D detail0; uniform sampler2D detail0;

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
uniform sampler2D diffuseMap; uniform sampler2D diffuseMap;
uniform sampler2D bumpMap; uniform sampler2D bumpMap;
uniform sampler2D screenTex; uniform sampler2D screenTex;

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
vec3 scaleSoftClip(vec3 inColor); vec3 scaleSoftClip(vec3 inColor);
vec3 atmosTransport(vec3 inColor); vec3 atmosTransport(vec3 inColor);
vec3 applyWaterFog(vec4 inColor); vec3 applyWaterFog(vec4 inColor);

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
vec4 applyWaterFog(vec4 color) vec4 applyWaterFog(vec4 color)
{ {
// GL_EXP2 Fog // GL_EXP2 Fog

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
void calcAtmospherics(vec3 inPositionEye); void calcAtmospherics(vec3 inPositionEye);
uniform vec2 d1; uniform vec2 d1;

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
uniform sampler2D diffuseMap; uniform sampler2D diffuseMap;
void main() void main()

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
void main() void main()
{ {
//transform vertex //transform vertex

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
uniform sampler2D diffuseMap; uniform sampler2D diffuseMap;
void default_lighting() void default_lighting()

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
uniform sampler2D diffuseMap; uniform sampler2D diffuseMap;

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
uniform sampler2D diffuseMap; uniform sampler2D diffuseMap;
uniform samplerCube environmentMap; uniform samplerCube environmentMap;

View File

@@ -0,0 +1,17 @@
/**
* @file lightFullbrightShinyWaterF.glsl
*
* Copyright (c) 2007-$CurrentYear$, Linden Research, Inc.
* $License$
*/
#version 120
uniform sampler2D diffuseMap;
uniform samplerCube environmentMap;
void fullbright_shiny_lighting_water()
{
gl_FragColor = texture2D(diffuseMap, gl_TexCoord[0].xy);
}

View File

@@ -6,6 +6,8 @@
*/ */
#version 120
uniform sampler2D diffuseMap; uniform sampler2D diffuseMap;
void fullbright_lighting_water() void fullbright_lighting_water()

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
float calcDirectionalLight(vec3 n, vec3 l) float calcDirectionalLight(vec3 n, vec3 l)
{ {
float a = max(dot(n,l),0.0); float a = max(dot(n,l),0.0);

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
float calcDirectionalLight(vec3 n, vec3 l) float calcDirectionalLight(vec3 n, vec3 l)
{ {

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
uniform sampler2D diffuseMap; uniform sampler2D diffuseMap;
uniform samplerCube environmentMap; uniform samplerCube environmentMap;

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
uniform sampler2D diffuseMap; uniform sampler2D diffuseMap;
uniform samplerCube environmentMap; uniform samplerCube environmentMap;

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
float calcDirectionalLight(vec3 n, vec3 l); float calcDirectionalLight(vec3 n, vec3 l);
// Same as non-specular lighting in lightV.glsl // Same as non-specular lighting in lightV.glsl

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
float calcDirectionalLight(vec3 n, vec3 l); float calcDirectionalLight(vec3 n, vec3 l);
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseLight) vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseLight)

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
uniform sampler2D diffuseMap; uniform sampler2D diffuseMap;
void default_lighting_water() void default_lighting_water()

View File

@@ -4,6 +4,9 @@
* Copyright (c) 2005-$CurrentYear$, Linden Research, Inc. * Copyright (c) 2005-$CurrentYear$, Linden Research, Inc.
* $License$ * $License$
*/ */
#version 120
float calcDirectionalLightSpecular(inout vec4 specular, vec3 view, vec3 n, vec3 l, vec3 lightCol, float da); float calcDirectionalLightSpecular(inout vec4 specular, vec3 view, vec3 n, vec3 l, vec3 lightCol, float da);
vec3 atmosAmbient(vec3 light); vec3 atmosAmbient(vec3 light);
vec3 atmosAffectDirectionalLight(float lightIntensity); vec3 atmosAffectDirectionalLight(float lightIntensity);

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
float calcDirectionalLight(vec3 n, vec3 l); float calcDirectionalLight(vec3 n, vec3 l);
vec3 atmosAmbient(vec3 light); vec3 atmosAmbient(vec3 light);

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
void fullbright_lighting(); void fullbright_lighting();
void main() void main()

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
void fullbright_shiny_lighting(); void fullbright_shiny_lighting();
void main() void main()

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
void calcAtmospherics(vec3 inPositionEye); void calcAtmospherics(vec3 inPositionEye);
uniform vec4 origin; uniform vec4 origin;

View File

@@ -0,0 +1,15 @@
/**
* @file fullbrightShinyWaterF.glsl
*
* Copyright (c) 2007-$CurrentYear$, Linden Research, Inc.
* $License$
*/
#version 120
void fullbright_shiny_lighting_water();
void main()
{
fullbright_shiny_lighting_water();
}

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
void calcAtmospherics(vec3 inPositionEye); void calcAtmospherics(vec3 inPositionEye);
void main() void main()

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
void fullbright_lighting_water(); void fullbright_lighting_water();
void main() void main()

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
void shiny_lighting(); void shiny_lighting();
void main() void main()

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
void calcAtmospherics(vec3 inPositionEye); void calcAtmospherics(vec3 inPositionEye);
uniform vec4 origin; uniform vec4 origin;

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
void shiny_lighting_water(); void shiny_lighting_water();
void main() void main()

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
void default_lighting(); void default_lighting();
void main() void main()

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
void calcAtmospherics(vec3 inPositionEye); void calcAtmospherics(vec3 inPositionEye);

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
void default_lighting_water(); void default_lighting_water();
void main() void main()

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
vec3 atmosLighting(vec3 light) vec3 atmosLighting(vec3 light)
{ {
/* stub function for fallback compatibility on class1 hardware */ /* stub function for fallback compatibility on class1 hardware */

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
vec3 atmosAmbient(vec3 light) vec3 atmosAmbient(vec3 light)
{ {
return gl_LightModel.ambient.rgb + light; return gl_LightModel.ambient.rgb + light;

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
void setPositionEye(vec3 v); void setPositionEye(vec3 v);
void calcAtmospherics(vec3 inPositionEye) void calcAtmospherics(vec3 inPositionEye)

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
varying vec3 vary_PositionEye; varying vec3 vary_PositionEye;
vec3 getPositionEye() vec3 getPositionEye()

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
varying vec3 vary_PositionEye; varying vec3 vary_PositionEye;

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
uniform vec4 gamma; uniform vec4 gamma;
/// Soft clips the light with a gamma correction /// Soft clips the light with a gamma correction

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
vec3 atmosTransport(vec3 light) vec3 atmosTransport(vec3 light)
{ {
/* stub function for fallback compatibility on class1 hardware */ /* stub function for fallback compatibility on class1 hardware */

View File

@@ -5,6 +5,8 @@
* $License$ * $License$
*/ */
#version 120
vec4 calcLightingSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor, vec4 baseCol); vec4 calcLightingSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor, vec4 baseCol);
void calcAtmospherics(vec3 inPositionEye); void calcAtmospherics(vec3 inPositionEye);

View File

@@ -5,6 +5,8 @@
* $/LicenseInfo$ * $/LicenseInfo$
*/ */
#version 120
#extension GL_ARB_texture_rectangle : enable #extension GL_ARB_texture_rectangle : enable
uniform sampler2D diffuseMap; uniform sampler2D diffuseMap;
@@ -26,7 +28,6 @@ varying vec3 vary_ambient;
varying vec3 vary_directional; varying vec3 vary_directional;
varying vec3 vary_fragcoord; varying vec3 vary_fragcoord;
varying vec3 vary_position; varying vec3 vary_position;
varying vec3 vary_light;
varying vec3 vary_pointlight_col; varying vec3 vary_pointlight_col;
uniform float shadow_bias; uniform float shadow_bias;

View File

@@ -5,6 +5,8 @@
* $/LicenseInfo$ * $/LicenseInfo$
*/ */
#version 120
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
void calcAtmospherics(vec3 inPositionEye); void calcAtmospherics(vec3 inPositionEye);
@@ -19,7 +21,6 @@ varying vec3 vary_ambient;
varying vec3 vary_directional; varying vec3 vary_directional;
varying vec3 vary_fragcoord; varying vec3 vary_fragcoord;
varying vec3 vary_position; varying vec3 vary_position;
varying vec3 vary_light;
varying vec3 vary_pointlight_col; varying vec3 vary_pointlight_col;
uniform float near_clip; uniform float near_clip;
@@ -67,12 +68,11 @@ void main()
calcAtmospherics(pos.xyz); calcAtmospherics(pos.xyz);
//vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.)); //vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.));
vec4 col = vec4(0.0, 0.0, 0.0, gl_Color.a); vec4 col = vec4(0.0, 0.0, 0.0, gl_Color.a);
// Collect normal lights // Collect normal lights
col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].quadraticAttenuation, gl_LightSource[2].specular.a); col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].quadraticAttenuation, gl_LightSource[2].specular.a);
col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].quadraticAttenuation, gl_LightSource[3].specular.a); col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].quadraticAttenuation ,gl_LightSource[3].specular.a);
col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].quadraticAttenuation, gl_LightSource[4].specular.a); col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].quadraticAttenuation, gl_LightSource[4].specular.a);
col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].quadraticAttenuation, gl_LightSource[5].specular.a); col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].quadraticAttenuation, gl_LightSource[5].specular.a);
col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].quadraticAttenuation, gl_LightSource[6].specular.a); col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].quadraticAttenuation, gl_LightSource[6].specular.a);
@@ -85,8 +85,6 @@ void main()
// Add windlight lights // Add windlight lights
col.rgb = atmosAmbient(vec3(0.)); col.rgb = atmosAmbient(vec3(0.));
vary_light = gl_LightSource[0].position.xyz;
vary_ambient = col.rgb*gl_Color.rgb; vary_ambient = col.rgb*gl_Color.rgb;
vary_directional.rgb = gl_Color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-gl_Color.a)*(1.0-gl_Color.a))); vary_directional.rgb = gl_Color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-gl_Color.a)*(1.0-gl_Color.a)));

View File

@@ -5,6 +5,8 @@
* $/LicenseInfo$ * $/LicenseInfo$
*/ */
#version 120
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
mat4 getSkinnedTransform(); mat4 getSkinnedTransform();
void calcAtmospherics(vec3 inPositionEye); void calcAtmospherics(vec3 inPositionEye);

View File

@@ -5,6 +5,8 @@
* $/LicenseInfo$ * $/LicenseInfo$
*/ */
#version 120
#extension GL_ARB_texture_rectangle : enable #extension GL_ARB_texture_rectangle : enable
uniform sampler2DRect depthMap; uniform sampler2DRect depthMap;

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