Commit 3c6473e2 authored by Mathias Goldau's avatar Mathias Goldau

[FIX] Now the WGELighting shaders will work again under MacOS and increase my hg churn

parent cb05107a
......@@ -26,28 +26,9 @@ void directionalLight( in int i, in vec3 normal, in float shininess,
ambient += gl_LightSource[i].ambient;
diffuse += gl_LightSource[i].diffuse * nDotVP;
specular += gl_LightSource[i].specular * pf;
}
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;
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);
/**
* Computes normal and makes transformation to eye space.
*/
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));
}
#include "WGEColorMaps.glsl"
#include "WGELighting.glsl"
#include "WGELighting-fragment.glsl"
void main()
......
#include "WGELighting.glsl"
#include "WGELighting-vertex.glsl"
void main()
{
......
......@@ -71,7 +71,7 @@ uniform int useCmap9;
#include "WGEColorMaps.glsl"
#include "WGELighting.glsl"
#include "WGELighting-fragment.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 "WGELighting.glsl"
#include "WGELighting-vertex.glsl"
void main()
{
......
......@@ -58,7 +58,7 @@ uniform int opacity;
#include "WGEColorMaps.glsl"
#include "WGELighting.glsl"
#include "WGELighting-fragment.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 "WGELighting.glsl"
#include "WGELighting-vertex.glsl"
void main()
{
......
......@@ -29,7 +29,7 @@
/////////////////////////////////////////////////////////////////////////////
#include "WMProbTractDisplay-varyings.glsl"
#include "WGELighting.glsl"
#include "WGELighting-fragment.glsl"
/////////////////////////////////////////////////////////////////////////////
// Uniforms
......
......@@ -2,7 +2,7 @@ varying vec4 VaryingTexCoord0;
uniform int opacity;
#include "WGELighting.glsl"
#include "WGELighting-fragment.glsl"
void main()
{
......
varying vec4 VaryingTexCoord0;
#include "WGELighting.glsl"
#include "WGELighting-vertex.glsl"
void main()
{
......
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