Commit 9977f6f7 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[CHANGE] - renamed OpenWalnut GE shaders to match naming scheme

parent b12e9f33
......@@ -5,7 +5,6 @@ varying vec3 halfvec;
const vec4 AMBIENT_BLACK = vec4(0.0, 0.0, 0.0, 1.0);
const vec4 DEFAULT_BLACK = vec4(0.0, 0.0, 0.0, 0.0);
void directionalLight( in int i, in vec3 normal, in float shininess,
inout vec4 ambient, inout vec4 diffuse, inout vec4 specular)
{
......@@ -30,9 +29,25 @@ void directionalLight( in int i, in vec3 normal, in float shininess,
}
void calculateLighting(in vec3 N, in float shininess, inout vec4 ambient, inout vec4 diffuse, inout vec4 specular)
{
directionalLight(0, N, shininess, ambient, diffuse, specular);
}
/**
* Use this method in the vertex shader to calculate several needed vectors per vertex. In Fragment Shader, the varyings "normal", "vertex" and
* "halfvec" contain the interpolated vectors per fragment.
*/
void prepareLight()
{
/* Calculate the normal */
normal = normalize(gl_NormalMatrix * gl_Normal).xyz;
/* Transform the vertex position to eye space */
vertex = vec4(gl_ModelViewMatrix * gl_Vertex);
vec3 L = normalize(gl_LightSource[0].position.xyz - vertex.xyz);
halfvec = vec3(L + vec3(0.0, 0.0, 1.0));
}
varying vec3 normal;
varying vec4 vertex;
varying vec3 halfvec;
void prepareLight()
{
/* Calculate the normal */
normal = normalize(gl_NormalMatrix * gl_Normal).xyz;
/* Transform the vertex position to eye space */
vertex = vec4(gl_ModelViewMatrix * gl_Vertex);
vec3 L = normalize(gl_LightSource[0].position.xyz - vertex.xyz);
halfvec = vec3(L + vec3(0.0, 0.0, 1.0));
}
......@@ -14,7 +14,7 @@ uniform float threshold;
uniform int cMap;
#include "colorMaps.fs"
#include "WGEColorMaps.glsl"
float lookupTex()
{
......
......@@ -10,8 +10,8 @@ uniform float threshold;
uniform int cMap;
#include "colorMaps.fs"
#include "utils.fs"
#include "WGEColorMaps.glsl"
#include "WGEUtils.glsl"
float lookupTex()
{
......
......@@ -56,7 +56,7 @@ uniform bool highlighted;
uniform bool showComplete;
#include "colorMaps.fs"
#include "WGEColorMaps.glsl"
void lookupTex( inout vec4 col, in int type, in sampler3D tex, in float threshold, in vec3 v, in float alpha, in int cmap)
......
......@@ -24,7 +24,7 @@
#version 120
#include "shadingTools.fs"
#include "WGEShadingTools.glsl"
/////////////////////////////////////////////////////////////////////////////
// Varyings
......
......@@ -24,7 +24,7 @@
#version 120
#include "transformationTools.fs"
#include "WGETransformationTools.glsl"
/////////////////////////////////////////////////////////////////////////////
// Varyings
......
......@@ -70,8 +70,8 @@ uniform int useCmap8;
uniform int useCmap9;
#include "colorMaps.fs"
#include "lighting.fs"
#include "WGEColorMaps.glsl"
#include "WGELighting.glsl"
void lookupTex(inout vec4 col, in int type, in sampler3D tex, in float threshold, in vec3 v, in float alpha, in int cmap)
{
......
varying vec4 VaryingTexCoord0;
#include "lighting.vs"
#include "WGELighting.glsl"
void main()
{
......
......@@ -57,8 +57,8 @@ uniform bool useTexture;
uniform int opacity;
#include "colorMaps.fs"
#include "lighting.fs"
#include "WGEColorMaps.glsl"
#include "WGELighting.glsl"
void lookupTex( inout vec4 col, in int type, in sampler3D tex, in float threshold, in vec3 v, in float alpha, in int cmap)
{
......
......@@ -7,7 +7,7 @@ varying vec4 VaryingTexCoord5;
varying vec4 VaryingTexCoord6;
varying vec4 VaryingTexCoord7;
#include "lighting.vs"
#include "WGELighting.glsl"
void main()
{
......
......@@ -29,7 +29,7 @@
/////////////////////////////////////////////////////////////////////////////
#include "DVRRaycast.varyings"
#include "lighting.fs"
#include "WGELighting.glsl"
/////////////////////////////////////////////////////////////////////////////
// Uniforms
......
......@@ -24,7 +24,7 @@
#version 120
#include "shadingTools.fs"
#include "WGEShadingTools.glsl"
// commonly used variables
#include "gpuSuperQuadrics.varyings"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment