Commit a21aa0fb authored by Martin Schultz's avatar Martin Schultz

added #version 330 implementation of depth_copy shader.

on osx with opengl 3.3 or higher, use version 330 implementation of depth_copy shader
parent 67771390
#version 330
uniform sampler2D DepthTex;
uniform float DepthSign;
in vec2 vTexCoord;
out vec4 oColor;
void main()
{
oColor = vec4(1.0, 1.0, 1.0, 1.0);
gl_FragDepth = texture(DepthTex, vTexCoord).x * DepthSign;
}
\ No newline at end of file
......@@ -1349,10 +1349,18 @@ QString IRenderer::dumpCurrentRenderObjectsToString(ACG::RenderObject** _list, b
void IRenderer::copyDepthToBackBuffer( GLuint _depthTex, float _scale /*= 1.0f*/ )
{
if (!_depthTex) return;
#ifdef __APPLE__
if(ACG::openGLVersion(3,3))
{
if (!depthCopyShader_)
depthCopyShader_ = GLSL::loadProgram("ScreenQuad/screenquad.glsl", "ScreenQuad/depth_copy_330.glsl");
}
else
#endif
{
if (!depthCopyShader_)
depthCopyShader_ = GLSL::loadProgram("ScreenQuad/screenquad.glsl", "ScreenQuad/depth_copy.glsl");
}
if (depthCopyShader_)
{
......
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