From 37017d0c16dff6bb06629d76799dae36127f69eb Mon Sep 17 00:00:00 2001 From: Sam Gateau Date: Tue, 30 Dec 2014 17:42:10 -0800 Subject: [PATCH] moving the deferrered shaders from the resource folder to built-in the executable --- .../resources/shaders/deferred_light.vert | 17 ---- .../shaders/deferred_light_limited.vert | 19 ----- .../resources/shaders/directional_light.frag | 71 ---------------- ...directional_light_cascaded_shadow_map.frag | 80 ------------------- .../shaders/directional_light_shadow_map.frag | 75 ----------------- interface/resources/shaders/point_light.frag | 75 ----------------- interface/resources/shaders/simple.frag | 25 ------ interface/resources/shaders/simple.vert | 26 ------ interface/resources/shaders/spot_light.frag | 77 ------------------ .../src/DeferredLightingEffect.cpp | 34 +++++--- .../render-utils/src/DeferredLightingEffect.h | 3 +- 11 files changed, 27 insertions(+), 475 deletions(-) delete mode 100644 interface/resources/shaders/deferred_light.vert delete mode 100644 interface/resources/shaders/deferred_light_limited.vert delete mode 100644 interface/resources/shaders/directional_light.frag delete mode 100644 interface/resources/shaders/directional_light_cascaded_shadow_map.frag delete mode 100644 interface/resources/shaders/directional_light_shadow_map.frag delete mode 100644 interface/resources/shaders/point_light.frag delete mode 100644 interface/resources/shaders/simple.frag delete mode 100644 interface/resources/shaders/simple.vert delete mode 100644 interface/resources/shaders/spot_light.frag diff --git a/interface/resources/shaders/deferred_light.vert b/interface/resources/shaders/deferred_light.vert deleted file mode 100644 index 88076165a7..0000000000 --- a/interface/resources/shaders/deferred_light.vert +++ /dev/null @@ -1,17 +0,0 @@ -#version 120 - -// -// deferred_light.vert -// vertex shader -// -// Created by Andrzej Kapolka on 9/18/14. -// Copyright 2014 High Fidelity, Inc. -// -// Distributed under the Apache License, Version 2.0. -// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -// - -void main(void) { - gl_TexCoord[0] = gl_MultiTexCoord0; - gl_Position = gl_Vertex; -} diff --git a/interface/resources/shaders/deferred_light_limited.vert b/interface/resources/shaders/deferred_light_limited.vert deleted file mode 100644 index f360f0307d..0000000000 --- a/interface/resources/shaders/deferred_light_limited.vert +++ /dev/null @@ -1,19 +0,0 @@ -#version 120 - -// -// deferred_light_limited.vert -// vertex shader -// -// Created by Andrzej Kapolka on 9/19/14. -// Copyright 2014 High Fidelity, Inc. -// -// Distributed under the Apache License, Version 2.0. -// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -// - -void main(void) { - gl_Position = ftransform(); - vec4 projected = gl_Position / gl_Position.w; - gl_TexCoord[0] = vec4(dot(projected, gl_ObjectPlaneS[3]) * gl_Position.w, - dot(projected, gl_ObjectPlaneT[3]) * gl_Position.w, 0.0, gl_Position.w); -} diff --git a/interface/resources/shaders/directional_light.frag b/interface/resources/shaders/directional_light.frag deleted file mode 100644 index 906a33ea74..0000000000 --- a/interface/resources/shaders/directional_light.frag +++ /dev/null @@ -1,71 +0,0 @@ -#version 120 - -// -// directional_light.frag -// fragment shader -// -// Created by Andrzej Kapolka on 9/3/14. -// Copyright 2014 High Fidelity, Inc. -// -// Distributed under the Apache License, Version 2.0. -// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -// - -// the diffuse texture -uniform sampler2D diffuseMap; - -// the normal texture -uniform sampler2D normalMap; - -// the specular texture -uniform sampler2D specularMap; - -// the depth texture -uniform sampler2D depthMap; - -// the distance to the near clip plane -uniform float near; - -// scale factor for depth: (far - near) / far -uniform float depthScale; - -// offset for depth texture coordinates -uniform vec2 depthTexCoordOffset; - -// scale for depth texture coordinates -uniform vec2 depthTexCoordScale; - -void main(void) { - float depthVal = texture2D(depthMap, gl_TexCoord[0].st).r; - vec4 normalVal = texture2D(normalMap, gl_TexCoord[0].st); - vec4 diffuseVal = texture2D(diffuseMap, gl_TexCoord[0].st); - vec4 specularVal = texture2D(specularMap, gl_TexCoord[0].st); - - // compute the view space position using the depth - float z = near / (depthVal * depthScale - 1.0); - vec4 position = vec4((depthTexCoordOffset + gl_TexCoord[0].st * depthTexCoordScale) * z, z, 0.0); - - // get the normal from the map - vec4 normal = normalVal; - if ((normalVal.a >= 0.45) && (normalVal.a <= 0.55)) { - normal.a = 1.0; - normalVal.a = 0.0; - gl_FragColor = vec4(diffuseVal.rgb * specularVal.rgb, 1.0); - } else { - vec3 normalizedNormal = normalize(normal.xyz * 2.0 - vec3(1.0)); - - // compute the base color based on OpenGL lighting model - float diffuse = dot(normalizedNormal, gl_LightSource[0].position.xyz); - float facingLight = step(0.0, diffuse); - vec3 baseColor = diffuseVal.rgb * (gl_FrontLightModelProduct.sceneColor.rgb + - gl_FrontLightProduct[0].ambient.rgb + gl_FrontLightProduct[0].diffuse.rgb * (diffuse * facingLight)); - - // compute the specular multiplier (sans exponent) - float specular = facingLight * max(0.0, dot(normalize(gl_LightSource[0].position.xyz - normalize(position.xyz)), - normalizedNormal)); - - // add specular contribution - vec4 specularColor = specularVal; - gl_FragColor = vec4(baseColor.rgb + pow(specular, specularColor.a * 128.0) * specularColor.rgb, normal.a); - } -} diff --git a/interface/resources/shaders/directional_light_cascaded_shadow_map.frag b/interface/resources/shaders/directional_light_cascaded_shadow_map.frag deleted file mode 100644 index ac9c784d9a..0000000000 --- a/interface/resources/shaders/directional_light_cascaded_shadow_map.frag +++ /dev/null @@ -1,80 +0,0 @@ -#version 120 - -// -// directional_light.frag -// fragment shader -// -// Created by Andrzej Kapolka on 9/3/14. -// Copyright 2014 High Fidelity, Inc. -// -// Distributed under the Apache License, Version 2.0. -// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -// - -// the diffuse texture -uniform sampler2D diffuseMap; - -// the normal texture -uniform sampler2D normalMap; - -// the specular texture -uniform sampler2D specularMap; - -// the depth texture -uniform sampler2D depthMap; - -// the shadow texture -uniform sampler2DShadow shadowMap; - -// the distances to the cascade sections -uniform vec3 shadowDistances; - -// the inverse of the size of the shadow map -uniform float shadowScale; - -// the distance to the near clip plane -uniform float near; - -// scale factor for depth: (far - near) / far -uniform float depthScale; - -// offset for depth texture coordinates -uniform vec2 depthTexCoordOffset; - -// scale for depth texture coordinates -uniform vec2 depthTexCoordScale; - -void main(void) { - // compute the view space position using the depth - float z = near / (texture2D(depthMap, gl_TexCoord[0].st).r * depthScale - 1.0); - vec4 position = vec4((depthTexCoordOffset + gl_TexCoord[0].st * depthTexCoordScale) * z, z, 1.0); - - // compute the index of the cascade to use and the corresponding texture coordinates - int shadowIndex = int(dot(step(vec3(position.z), shadowDistances), vec3(1.0, 1.0, 1.0))); - vec3 shadowTexCoord = vec3(dot(gl_EyePlaneS[shadowIndex], position), dot(gl_EyePlaneT[shadowIndex], position), - dot(gl_EyePlaneR[shadowIndex], position)); - - // get the normal from the map - vec4 normal = texture2D(normalMap, gl_TexCoord[0].st); - vec4 normalizedNormal = normalize(normal * 2.0 - vec4(1.0, 1.0, 1.0, 2.0)); - - // average values from the shadow map - float diffuse = dot(normalizedNormal, gl_LightSource[0].position); - float facingLight = step(0.0, diffuse) * 0.25 * - (shadow2D(shadowMap, shadowTexCoord + vec3(-shadowScale, -shadowScale, 0.0)).r + - shadow2D(shadowMap, shadowTexCoord + vec3(-shadowScale, shadowScale, 0.0)).r + - shadow2D(shadowMap, shadowTexCoord + vec3(shadowScale, -shadowScale, 0.0)).r + - shadow2D(shadowMap, shadowTexCoord + vec3(shadowScale, shadowScale, 0.0)).r); - - // compute the base color based on OpenGL lighting model - vec4 baseColor = texture2D(diffuseMap, gl_TexCoord[0].st) * (gl_FrontLightModelProduct.sceneColor + - gl_FrontLightProduct[0].ambient + gl_FrontLightProduct[0].diffuse * (diffuse * facingLight)); - - // compute the specular multiplier (sans exponent) - float specular = facingLight * max(0.0, dot(normalize(gl_LightSource[0].position - normalize(vec4(position.xyz, 0.0))), - normalizedNormal)); - - // add specular contribution - vec4 specularColor = texture2D(specularMap, gl_TexCoord[0].st); - gl_FragColor = vec4(baseColor.rgb + pow(specular, specularColor.a * 128.0) * specularColor.rgb, normal.a); -} diff --git a/interface/resources/shaders/directional_light_shadow_map.frag b/interface/resources/shaders/directional_light_shadow_map.frag deleted file mode 100644 index f1eaa20826..0000000000 --- a/interface/resources/shaders/directional_light_shadow_map.frag +++ /dev/null @@ -1,75 +0,0 @@ -#version 120 - -// -// directional_light.frag -// fragment shader -// -// Created by Andrzej Kapolka on 9/3/14. -// Copyright 2014 High Fidelity, Inc. -// -// Distributed under the Apache License, Version 2.0. -// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -// - -// the diffuse texture -uniform sampler2D diffuseMap; - -// the normal texture -uniform sampler2D normalMap; - -// the specular texture -uniform sampler2D specularMap; - -// the depth texture -uniform sampler2D depthMap; - -// the shadow texture -uniform sampler2DShadow shadowMap; - -// the inverse of the size of the shadow map -uniform float shadowScale; - -// the distance to the near clip plane -uniform float near; - -// scale factor for depth: (far - near) / far -uniform float depthScale; - -// offset for depth texture coordinates -uniform vec2 depthTexCoordOffset; - -// scale for depth texture coordinates -uniform vec2 depthTexCoordScale; - -void main(void) { - // compute the view space position using the depth - float z = near / (texture2D(depthMap, gl_TexCoord[0].st).r * depthScale - 1.0); - vec4 position = vec4((depthTexCoordOffset + gl_TexCoord[0].st * depthTexCoordScale) * z, z, 1.0); - - // compute the corresponding texture coordinates - vec3 shadowTexCoord = vec3(dot(gl_EyePlaneS[0], position), dot(gl_EyePlaneT[0], position), dot(gl_EyePlaneR[0], position)); - - // get the normal from the map - vec4 normal = texture2D(normalMap, gl_TexCoord[0].st); - vec4 normalizedNormal = normalize(normal * 2.0 - vec4(1.0, 1.0, 1.0, 2.0)); - - // average values from the shadow map - float diffuse = dot(normalizedNormal, gl_LightSource[0].position); - float facingLight = step(0.0, diffuse) * 0.25 * - (shadow2D(shadowMap, shadowTexCoord + vec3(-shadowScale, -shadowScale, 0.0)).r + - shadow2D(shadowMap, shadowTexCoord + vec3(-shadowScale, shadowScale, 0.0)).r + - shadow2D(shadowMap, shadowTexCoord + vec3(shadowScale, -shadowScale, 0.0)).r + - shadow2D(shadowMap, shadowTexCoord + vec3(shadowScale, shadowScale, 0.0)).r); - - // compute the base color based on OpenGL lighting model - vec4 baseColor = texture2D(diffuseMap, gl_TexCoord[0].st) * (gl_FrontLightModelProduct.sceneColor + - gl_FrontLightProduct[0].ambient + gl_FrontLightProduct[0].diffuse * (diffuse * facingLight)); - - // compute the specular multiplier (sans exponent) - float specular = facingLight * max(0.0, dot(normalize(gl_LightSource[0].position - normalize(vec4(position.xyz, 0.0))), - normalizedNormal)); - - // add specular contribution - vec4 specularColor = texture2D(specularMap, gl_TexCoord[0].st); - gl_FragColor = vec4(baseColor.rgb + pow(specular, specularColor.a * 128.0) * specularColor.rgb, normal.a); -} diff --git a/interface/resources/shaders/point_light.frag b/interface/resources/shaders/point_light.frag deleted file mode 100644 index 1d1b4f4073..0000000000 --- a/interface/resources/shaders/point_light.frag +++ /dev/null @@ -1,75 +0,0 @@ -#version 120 - -// -// spot_light.frag -// fragment shader -// -// Created by Andrzej Kapolka on 9/18/14. -// Copyright 2014 High Fidelity, Inc. -// -// Distributed under the Apache License, Version 2.0. -// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -// - -// the diffuse texture -uniform sampler2D diffuseMap; - -// the normal texture -uniform sampler2D normalMap; - -// the specular texture -uniform sampler2D specularMap; - -// the depth texture -uniform sampler2D depthMap; - -// the distance to the near clip plane -uniform float near; - -// scale factor for depth: (far - near) / far -uniform float depthScale; - -// offset for depth texture coordinates -uniform vec2 depthTexCoordOffset; - -// scale for depth texture coordinates -uniform vec2 depthTexCoordScale; - -// the radius (hard cutoff) of the light effect -uniform float radius; - -void main(void) { - // get the depth and exit early if it doesn't pass the test - vec2 texCoord = gl_TexCoord[0].st / gl_TexCoord[0].q; - float depth = texture2D(depthMap, texCoord).r; - if (depth < gl_FragCoord.z) { - discard; - } - // compute the view space position using the depth - float z = near / (depth * depthScale - 1.0); - vec4 position = vec4((depthTexCoordOffset + texCoord * depthTexCoordScale) * z, z, 1.0); - - // get the normal from the map - vec4 normal = texture2D(normalMap, texCoord); - vec4 normalizedNormal = normalize(normal * 2.0 - vec4(1.0, 1.0, 1.0, 2.0)); - - // compute the base color based on OpenGL lighting model - vec4 lightVector = gl_LightSource[1].position - position; - float lightDistance = length(lightVector); - lightVector = lightVector / lightDistance; - float diffuse = dot(normalizedNormal, lightVector); - float facingLight = step(0.0, diffuse); - vec4 baseColor = texture2D(diffuseMap, texCoord) * (gl_FrontLightProduct[1].ambient + - gl_FrontLightProduct[1].diffuse * (diffuse * facingLight)); - - // compute attenuation based on distance, etc. - float attenuation = step(lightDistance, radius) / dot(vec3(gl_LightSource[1].constantAttenuation, - gl_LightSource[1].linearAttenuation, gl_LightSource[1].quadraticAttenuation), - vec3(1.0, lightDistance, lightDistance * lightDistance)); - - // add base to specular, modulate by attenuation - float specular = facingLight * max(0.0, dot(normalize(lightVector - normalize(vec4(position.xyz, 0.0))), - normalizedNormal)); - vec4 specularColor = texture2D(specularMap, texCoord); - gl_FragColor = vec4((baseColor.rgb + pow(specular, specularColor.a * 128.0) * specularColor.rgb) * attenuation, 0.0); -} diff --git a/interface/resources/shaders/simple.frag b/interface/resources/shaders/simple.frag deleted file mode 100644 index 347cb0a859..0000000000 --- a/interface/resources/shaders/simple.frag +++ /dev/null @@ -1,25 +0,0 @@ -#version 120 - -// -// simple.frag -// fragment shader -// -// Created by Andrzej Kapolka on 9/15/14. -// Copyright 2014 High Fidelity, Inc. -// -// Distributed under the Apache License, Version 2.0. -// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -// - -// the interpolated normal -varying vec4 normal; - -// the glow intensity -uniform float glowIntensity; - -void main(void) { - // set the diffuse, normal, specular data - gl_FragData[0] = vec4(gl_Color.rgb, glowIntensity); - gl_FragData[1] = normalize(normal) * 0.5 + vec4(0.5, 0.5, 0.5, 1.0); - gl_FragData[2] = vec4(gl_FrontMaterial.specular.rgb, gl_FrontMaterial.shininess / 128.0); -} diff --git a/interface/resources/shaders/simple.vert b/interface/resources/shaders/simple.vert deleted file mode 100644 index c8fa0a9ebb..0000000000 --- a/interface/resources/shaders/simple.vert +++ /dev/null @@ -1,26 +0,0 @@ -#version 120 - -// -// simple.vert -// vertex shader -// -// Created by Andrzej Kapolka on 9/15/14. -// Copyright 2014 High Fidelity, Inc. -// -// Distributed under the Apache License, Version 2.0. -// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -// - -// the interpolated normal -varying vec4 normal; - -void main(void) { - // transform and store the normal for interpolation - normal = normalize(gl_ModelViewMatrix * vec4(gl_Normal, 0.0)); - - // pass along the diffuse color - gl_FrontColor = gl_Color; - - // use standard pipeline transform - gl_Position = ftransform(); -} diff --git a/interface/resources/shaders/spot_light.frag b/interface/resources/shaders/spot_light.frag deleted file mode 100644 index 590ed8b6ac..0000000000 --- a/interface/resources/shaders/spot_light.frag +++ /dev/null @@ -1,77 +0,0 @@ -#version 120 - -// -// spot_light.frag -// fragment shader -// -// Created by Andrzej Kapolka on 9/18/14. -// Copyright 2014 High Fidelity, Inc. -// -// Distributed under the Apache License, Version 2.0. -// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -// - -// the diffuse texture -uniform sampler2D diffuseMap; - -// the normal texture -uniform sampler2D normalMap; - -// the specular texture -uniform sampler2D specularMap; - -// the depth texture -uniform sampler2D depthMap; - -// the distance to the near clip plane -uniform float near; - -// scale factor for depth: (far - near) / far -uniform float depthScale; - -// offset for depth texture coordinates -uniform vec2 depthTexCoordOffset; - -// scale for depth texture coordinates -uniform vec2 depthTexCoordScale; - -// the radius (hard cutoff) of the light effect -uniform float radius; - -void main(void) { - // get the depth and exit early if it doesn't pass the test - vec2 texCoord = gl_TexCoord[0].st / gl_TexCoord[0].q; - float depth = texture2D(depthMap, texCoord).r; - if (depth < gl_FragCoord.z) { - discard; - } - // compute the view space position using the depth - float z = near / (depth * depthScale - 1.0); - vec4 position = vec4((depthTexCoordOffset + texCoord * depthTexCoordScale) * z, z, 1.0); - - // get the normal from the map - vec4 normal = texture2D(normalMap, texCoord); - vec4 normalizedNormal = normalize(normal * 2.0 - vec4(1.0, 1.0, 1.0, 2.0)); - - // compute the base color based on OpenGL lighting model - vec4 lightVector = gl_LightSource[1].position - position; - float lightDistance = length(lightVector); - lightVector = lightVector / lightDistance; - float diffuse = dot(normalizedNormal, lightVector); - float facingLight = step(0.0, diffuse); - vec4 baseColor = texture2D(diffuseMap, texCoord) * (gl_FrontLightProduct[1].ambient + - gl_FrontLightProduct[1].diffuse * (diffuse * facingLight)); - - // compute attenuation based on spot angle, distance, etc. - float cosSpotAngle = max(-dot(lightVector.xyz, gl_LightSource[1].spotDirection), 0.0); - float attenuation = step(lightDistance, radius) * step(gl_LightSource[1].spotCosCutoff, cosSpotAngle) * - pow(cosSpotAngle, gl_LightSource[1].spotExponent) / dot(vec3(gl_LightSource[1].constantAttenuation, - gl_LightSource[1].linearAttenuation, gl_LightSource[1].quadraticAttenuation), - vec3(1.0, lightDistance, lightDistance * lightDistance)); - - // add base to specular, modulate by attenuation - float specular = facingLight * max(0.0, dot(normalize(lightVector - normalize(vec4(position.xyz, 0.0))), - normalizedNormal)); - vec4 specularColor = texture2D(specularMap, texCoord); - gl_FragColor = vec4((baseColor.rgb + pow(specular, specularColor.a * 128.0) * specularColor.rgb) * attenuation, 0.0); -} diff --git a/libraries/render-utils/src/DeferredLightingEffect.cpp b/libraries/render-utils/src/DeferredLightingEffect.cpp index 0dd6f9d0b8..c59bc90035 100644 --- a/libraries/render-utils/src/DeferredLightingEffect.cpp +++ b/libraries/render-utils/src/DeferredLightingEffect.cpp @@ -25,24 +25,37 @@ #include "RenderUtil.h" #include "TextureCache.h" +#include "simple_vert.h" +#include "simple_frag.h" + +#include "deferred_light_vert.h" +#include "deferred_light_limited_vert.h" + +#include "directional_light_frag.h" +#include "directional_light_shadow_map_frag.h" +#include "directional_light_cascaded_shadow_map_frag.h" + +#include "point_light_frag.h" +#include "spot_light_frag.h" + void DeferredLightingEffect::init(AbstractViewStateInterface* viewState) { _viewState = viewState; - _simpleProgram.addShaderFromSourceFile(QGLShader::Vertex, PathUtils::resourcesPath() + "shaders/simple.vert"); - _simpleProgram.addShaderFromSourceFile(QGLShader::Fragment, PathUtils::resourcesPath() + "shaders/simple.frag"); + _simpleProgram.addShaderFromSourceCode(QGLShader::Vertex, simple_vert); + _simpleProgram.addShaderFromSourceCode(QGLShader::Fragment, simple_frag); _simpleProgram.link(); _simpleProgram.bind(); _glowIntensityLocation = _simpleProgram.uniformLocation("glowIntensity"); _simpleProgram.release(); - loadLightProgram("shaders/directional_light.frag", false, _directionalLight, _directionalLightLocations); - loadLightProgram("shaders/directional_light_shadow_map.frag", false, _directionalLightShadowMap, + loadLightProgram(directional_light_frag, false, _directionalLight, _directionalLightLocations); + loadLightProgram(directional_light_shadow_map_frag, false, _directionalLightShadowMap, _directionalLightShadowMapLocations); - loadLightProgram("shaders/directional_light_cascaded_shadow_map.frag", false, _directionalLightCascadedShadowMap, + loadLightProgram(directional_light_cascaded_shadow_map_frag, false, _directionalLightCascadedShadowMap, _directionalLightCascadedShadowMapLocations); - loadLightProgram("shaders/point_light.frag", true, _pointLight, _pointLightLocations); - loadLightProgram("shaders/spot_light.frag", true, _spotLight, _spotLightLocations); + loadLightProgram(point_light_frag, true, _pointLight, _pointLightLocations); + loadLightProgram(spot_light_frag, true, _spotLight, _spotLightLocations); } void DeferredLightingEffect::bindSimpleProgram() { @@ -400,10 +413,13 @@ void DeferredLightingEffect::render() { _postLightingRenderables.clear(); } -void DeferredLightingEffect::loadLightProgram(const char* name, bool limited, ProgramObject& program, LightLocations& locations) { - program.addShaderFromSourceFile(QGLShader::Vertex, PathUtils::resourcesPath() + +void DeferredLightingEffect::loadLightProgram(const char* fragSource, bool limited, ProgramObject& program, LightLocations& locations) { + /* program.addShaderFromSourceFile(QGLShader::Vertex, PathUtils::resourcesPath() + (limited ? "shaders/deferred_light_limited.vert" : "shaders/deferred_light.vert")); program.addShaderFromSourceFile(QGLShader::Fragment, PathUtils::resourcesPath() + name); + */ + program.addShaderFromSourceCode(QGLShader::Vertex, (limited ? deferred_light_limited_vert : deferred_light_vert)); + program.addShaderFromSourceCode(QGLShader::Fragment, fragSource); program.link(); program.bind(); diff --git a/libraries/render-utils/src/DeferredLightingEffect.h b/libraries/render-utils/src/DeferredLightingEffect.h index 4f3b930a09..5b73a75461 100644 --- a/libraries/render-utils/src/DeferredLightingEffect.h +++ b/libraries/render-utils/src/DeferredLightingEffect.h @@ -86,7 +86,8 @@ private: int radius; }; - static void loadLightProgram(const char* name, bool limited, ProgramObject& program, LightLocations& locations); + //static void loadLightProgram(const char* name, bool limited, ProgramObject& program, LightLocations& locations); + static void loadLightProgram(const char* fragSource, bool limited, ProgramObject& program, LightLocations& locations); ProgramObject _simpleProgram; int _glowIntensityLocation;