diff options
Diffstat (limited to 'chart2/opengl')
26 files changed, 0 insertions, 1050 deletions
diff --git a/chart2/opengl/backgroundFragmentShader.glsl b/chart2/opengl/backgroundFragmentShader.glsl deleted file mode 100644 index d602b21a3488..000000000000 --- a/chart2/opengl/backgroundFragmentShader.glsl +++ /dev/null @@ -1,19 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#version 150 core - -in vec4 fragmentColor; - -void main() -{ - gl_FragColor = fragmentColor; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/opengl/backgroundVertexShader.glsl b/chart2/opengl/backgroundVertexShader.glsl deleted file mode 100644 index bf7937cafffd..000000000000 --- a/chart2/opengl/backgroundVertexShader.glsl +++ /dev/null @@ -1,23 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#version 150 core - -in vec3 vPosition; -uniform mat4 MVP; -in vec4 vColor; -out vec4 fragmentColor; - -void main() -{ - gl_Position = MVP * vec4(vPosition, 1); - fragmentColor = vColor; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/opengl/commonFragmentShader.glsl b/chart2/opengl/commonFragmentShader.glsl deleted file mode 100644 index bb2482b4a57b..000000000000 --- a/chart2/opengl/commonFragmentShader.glsl +++ /dev/null @@ -1,20 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#version 150 core - -in vec4 fragmentColor; -out vec4 actualColor; - -void main() -{ - actualColor = fragmentColor; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/opengl/commonVertexShader.glsl b/chart2/opengl/commonVertexShader.glsl deleted file mode 100644 index 145d4db2fcae..000000000000 --- a/chart2/opengl/commonVertexShader.glsl +++ /dev/null @@ -1,23 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#version 150 core - -in vec3 vPosition; -uniform mat4 MVP; -uniform vec4 vColor; -out vec4 fragmentColor; - -void main() -{ - gl_Position = MVP * vec4(vPosition, 1); - fragmentColor = vColor; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/opengl/debugFragmentShader.glsl b/chart2/opengl/debugFragmentShader.glsl deleted file mode 100644 index 92b005edc862..000000000000 --- a/chart2/opengl/debugFragmentShader.glsl +++ /dev/null @@ -1,19 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#version 150 core - -in vec4 fragmentColor; - -void main() -{ - gl_FragColor = vec4(1.0, 1.0, 0.0, 0.5); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/opengl/debugVertexShader.glsl b/chart2/opengl/debugVertexShader.glsl deleted file mode 100644 index a542da88b911..000000000000 --- a/chart2/opengl/debugVertexShader.glsl +++ /dev/null @@ -1,21 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#version 150 core - -in vec3 vPosition; -uniform vec4 vColor; -out vec4 fragmentColor; - -void main() -{ - gl_Position = vec4(vPosition, 1); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/opengl/pickingFragmentShader.glsl b/chart2/opengl/pickingFragmentShader.glsl deleted file mode 100644 index 6262216a6d77..000000000000 --- a/chart2/opengl/pickingFragmentShader.glsl +++ /dev/null @@ -1,24 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#version 150 core - -uniform float minCoordX; -in vec3 positionWorldspace; -in vec4 fragmentColor; -out vec4 actualColor; - -void main() -{ - if (positionWorldspace.x <= minCoordX) - discard; - actualColor = fragmentColor; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/opengl/pickingVertexShader.glsl b/chart2/opengl/pickingVertexShader.glsl deleted file mode 100644 index 9dc5a1463a23..000000000000 --- a/chart2/opengl/pickingVertexShader.glsl +++ /dev/null @@ -1,28 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#version 150 core - -in vec3 vPosition; -uniform mat4 MVP; -uniform mat4 M; -uniform vec4 vColor; -uniform float minCoordX; -uniform float maxCoordX; -out vec4 fragmentColor; -out vec3 positionWorldspace; -void main() -{ - positionWorldspace = (M * vec4(vPosition,1)).xyz; - positionWorldspace.x = clamp(positionWorldspace.x, minCoordX, maxCoordX); - gl_Position = MVP * vec4(vPosition, 1); - fragmentColor = vColor; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/opengl/renderTextureFragmentShader.glsl b/chart2/opengl/renderTextureFragmentShader.glsl deleted file mode 100644 index 52dfde821a7d..000000000000 --- a/chart2/opengl/renderTextureFragmentShader.glsl +++ /dev/null @@ -1,21 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#version 150 core - -uniform sampler2D RenderTex; -in vec2 vTexCoord; -out vec4 actualColor; - -void main() -{ - actualColor = vec4(texture(RenderTex, vTexCoord).rgb, 1.0); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/opengl/renderTextureVertexShader.glsl b/chart2/opengl/renderTextureVertexShader.glsl deleted file mode 100644 index b9307fb32527..000000000000 --- a/chart2/opengl/renderTextureVertexShader.glsl +++ /dev/null @@ -1,21 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#version 150 core - -in vec4 vPosition; -in vec2 texCoord; -out vec2 vTexCoord; -void main() -{ - gl_Position = vPosition; - vTexCoord = texCoord; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/opengl/screenTextFragmentShader.glsl b/chart2/opengl/screenTextFragmentShader.glsl deleted file mode 100644 index f60b54fd4248..000000000000 --- a/chart2/opengl/screenTextFragmentShader.glsl +++ /dev/null @@ -1,23 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#version 150 core - -in vec2 vTexCoord; -uniform sampler2D TextTex; -uniform vec4 textColor; -out vec4 actualColor; -void main() -{ - vec3 color = texture2D(TextTex, vTexCoord).rgb; - actualColor = ((1.0 - color.r) == 0.0) ? vec4(0.0, 0.0, 0.0, textColor.a) : - vec4(textColor.rgb, 1.0); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/opengl/screenTextVertexShader.glsl b/chart2/opengl/screenTextVertexShader.glsl deleted file mode 100644 index b0ab221cb032..000000000000 --- a/chart2/opengl/screenTextVertexShader.glsl +++ /dev/null @@ -1,21 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#version 150 core - -in vec3 vPosition; -in vec2 texCoord; -out vec2 vTexCoord; -void main() -{ - gl_Position = vec4(vPosition, 1); - vTexCoord = texCoord; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/opengl/shape3DFragmentShader.glsl b/chart2/opengl/shape3DFragmentShader.glsl deleted file mode 100644 index 5c1614ce3252..000000000000 --- a/chart2/opengl/shape3DFragmentShader.glsl +++ /dev/null @@ -1,112 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#version 330 core -#define MAX_LIGHT_NUM 8 - -in vec3 positionWorldspace; -in vec3 normalCameraspace; -uniform mat4 V; -out vec4 actualColor; -struct MaterialParameters -{ - vec4 ambient; - vec4 diffuse; - vec4 specular; - vec4 materialColor; - - int twoSidesLighting; - float shininess; - float pad; - float pad1; -}; - -layout(std140) uniform GlobalMaterialParameters -{ - MaterialParameters matralParameter; -}Material; - -struct LightSource -{ - vec4 lightColor; - vec4 positionWorldspace; - float lightPower; - float pad1; - float pad2; - float pad3; -}; - -layout(std140) uniform GlobalLights -{ - int lightNum; - vec4 ambient; - LightSource light[MAX_LIGHT_NUM]; -} Lights; - -void main() -{ - vec3 colorTotal = vec3(0.0f, 0.0f, 0.0f); - - vec3 vertexPositionCameraspace = (V * vec4(positionWorldspace,1)).xyz; - - vec3 MaterialDiffuseColor = Material.matralParameter.materialColor.rgb; - - vec3 normalDirectionCameraspace = normalCameraspace; - vec3 eyeDirectionCameraspace = normalize(vec3(0, 0, 0) - vertexPositionCameraspace); - float attenuation = 1.0; - int i = 0; - vec3 lightDirectionCameraspace; - vec3 vertexToLightSource; - - vec3 lightAmbient = Lights.ambient.rgb * - MaterialDiffuseColor * - Material.matralParameter.ambient.rgb - * 5.0; - - if ((Material.matralParameter.twoSidesLighting == 1) && (!gl_FrontFacing)) - { - normalDirectionCameraspace = -normalDirectionCameraspace; - } - for (i = 0; i < Lights.lightNum; i++) - { - float LightPower = Lights.light[i].lightPower; - lightDirectionCameraspace = normalize((V * Lights.light[i].positionWorldspace).xyz); - - float cosTheta = clamp(dot(normalDirectionCameraspace,lightDirectionCameraspace), 0,1); - vec3 lightDiffuse = LightPower * - attenuation * - Lights.light[i].lightColor.rgb * - MaterialDiffuseColor * - Material.matralParameter.diffuse.rgb * - cosTheta; - - vec3 specularReflection; - if (dot(normalDirectionCameraspace, lightDirectionCameraspace) < 0) - { - specularReflection = vec3(0.0, 0.0, 0.0); - } - else - { - vec3 R = reflect(-lightDirectionCameraspace,normalDirectionCameraspace); - float cosAlpha = clamp(dot(eyeDirectionCameraspace, R), 0,1); - specularReflection = attenuation * - LightPower * - Lights.light[i].lightColor.rgb * - Material.matralParameter.specular.rgb * - MaterialDiffuseColor * - pow(max(0.0, cosAlpha), Material.matralParameter.shininess); - } - colorTotal += lightDiffuse + specularReflection; - - } - colorTotal += lightAmbient; - actualColor = vec4(colorTotal, 1.0); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/opengl/shape3DFragmentShaderBatch.glsl b/chart2/opengl/shape3DFragmentShaderBatch.glsl deleted file mode 100644 index e2a096155bc2..000000000000 --- a/chart2/opengl/shape3DFragmentShaderBatch.glsl +++ /dev/null @@ -1,108 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#version 330 core -#define MAX_LIGHT_NUM 8 - -in vec3 positionWorldspace; -in vec3 normalCameraspace; -in vec4 fragBarColor; -uniform mat4 V; -out vec4 actualColor; -struct MaterialParameters -{ - vec4 ambient; - vec4 diffuse; - vec4 specular; - vec4 materialColor; - - int twoSidesLighting; - float shininess; - float pad; - float pad1; -}; - -layout(std140) uniform GlobalMaterialParameters -{ - MaterialParameters matralParameter; -}Material; - -struct LightSource -{ - vec4 lightColor; - vec4 positionWorldspace; - float lightPower; - float pad1; - float pad2; - float pad3; -}; - -layout(std140) uniform GlobalLights -{ - int lightNum; - vec4 ambient; - LightSource light[MAX_LIGHT_NUM]; -} Lights; - -void main() -{ - vec3 colorTotal = vec3(0.0f, 0.0f, 0.0f); - - vec3 vertexPositionCameraspace = (V * vec4(positionWorldspace,1)).xyz; - - vec3 MaterialDiffuseColor = fragBarColor.rgb; - - vec3 normalDirectionCameraspace = normalCameraspace; - vec3 eyeDirectionCameraspace = normalize(vec3(0, 0, 0) - vertexPositionCameraspace); - float attenuation = 1.0; - int i = 0; - vec3 lightDirectionCameraspace; - vec3 vertexToLightSource; - - vec3 lightAmbient = Lights.ambient.rgb * - MaterialDiffuseColor * - Material.matralParameter.ambient.rgb; - - for (i = 0; i < Lights.lightNum; i++) - { - float LightPower = Lights.light[i].lightPower; - lightDirectionCameraspace = normalize((V * Lights.light[i].positionWorldspace).xyz); - - float cosTheta = clamp(dot(normalDirectionCameraspace,lightDirectionCameraspace), 0,1); - vec3 lightDiffuse = LightPower * - attenuation * - Lights.light[i].lightColor.rgb * - MaterialDiffuseColor * - Material.matralParameter.diffuse.rgb * - cosTheta; - - vec3 specularReflection; - if (dot(normalDirectionCameraspace, lightDirectionCameraspace) < 0) - { - specularReflection = vec3(0.0, 0.0, 0.0); - } - else - { - vec3 R = reflect(-lightDirectionCameraspace,normalDirectionCameraspace); - float cosAlpha = clamp(dot(eyeDirectionCameraspace, R), 0,1); - specularReflection = attenuation * - LightPower * - Lights.light[i].lightColor.rgb * - Material.matralParameter.specular.rgb * - MaterialDiffuseColor * - pow(max(0.0, cosAlpha), Material.matralParameter.shininess); - } - colorTotal += lightDiffuse + specularReflection; - - } - colorTotal += lightAmbient; - actualColor = vec4(colorTotal, 1.0); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/opengl/shape3DFragmentShaderBatchScroll.glsl b/chart2/opengl/shape3DFragmentShaderBatchScroll.glsl deleted file mode 100644 index a4686a31e26a..000000000000 --- a/chart2/opengl/shape3DFragmentShaderBatchScroll.glsl +++ /dev/null @@ -1,112 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#version 330 core -#define MAX_LIGHT_NUM 8 - -in vec3 positionWorldspace; -in vec3 normalCameraspace; -in vec4 fragBarColor; -uniform mat4 V; -uniform int undraw; -uniform float minCoordX; -out vec4 actualColor; -struct MaterialParameters -{ - vec4 ambient; - vec4 diffuse; - vec4 specular; - vec4 materialColor; - - int twoSidesLighting; - float shininess; - float pad; - float pad1; -}; - -layout(std140) uniform GlobalMaterialParameters -{ - MaterialParameters matralParameter; -}Material; - -struct LightSource -{ - vec4 lightColor; - vec4 positionWorldspace; - float lightPower; - float pad1; - float pad2; - float pad3; -}; - -layout(std140) uniform GlobalLights -{ - int lightNum; - vec4 ambient; - LightSource light[MAX_LIGHT_NUM]; -} Lights; - -void main() -{ - if ((positionWorldspace.x <= minCoordX) && (undraw == 1)) - discard; - vec3 colorTotal = vec3(0.0f, 0.0f, 0.0f); - - vec3 vertexPositionCameraspace = (V * vec4(positionWorldspace,1)).xyz; - - vec3 MaterialDiffuseColor = fragBarColor.rgb; - - vec3 normalDirectionCameraspace = normalCameraspace; - vec3 eyeDirectionCameraspace = normalize(vec3(0, 0, 0) - vertexPositionCameraspace); - float attenuation = 1.0; - int i = 0; - vec3 lightDirectionCameraspace; - vec3 vertexToLightSource; - - vec3 lightAmbient = Lights.ambient.rgb * - MaterialDiffuseColor * - Material.matralParameter.ambient.rgb; - - for (i = 0; i < Lights.lightNum; i++) - { - float LightPower = Lights.light[i].lightPower; - lightDirectionCameraspace = normalize((V * Lights.light[i].positionWorldspace).xyz); - - float cosTheta = clamp(dot(normalDirectionCameraspace,lightDirectionCameraspace), 0,1); - vec3 lightDiffuse = LightPower * - attenuation * - Lights.light[i].lightColor.rgb * - MaterialDiffuseColor * - Material.matralParameter.diffuse.rgb * - cosTheta; - - vec3 specularReflection; - if (dot(normalDirectionCameraspace, lightDirectionCameraspace) < 0) - { - specularReflection = vec3(0.0, 0.0, 0.0); - } - else - { - vec3 R = reflect(-lightDirectionCameraspace,normalDirectionCameraspace); - float cosAlpha = clamp(dot(eyeDirectionCameraspace, R), 0,1); - specularReflection = attenuation * - LightPower * - Lights.light[i].lightColor.rgb * - Material.matralParameter.specular.rgb * - MaterialDiffuseColor * - pow(max(0.0, cosAlpha), Material.matralParameter.shininess); - } - colorTotal += lightDiffuse + specularReflection; - - } - colorTotal += lightAmbient; - actualColor = vec4(colorTotal, 1.0); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/opengl/shape3DFragmentShaderV300.glsl b/chart2/opengl/shape3DFragmentShaderV300.glsl deleted file mode 100644 index 9a8ddeaa9b54..000000000000 --- a/chart2/opengl/shape3DFragmentShaderV300.glsl +++ /dev/null @@ -1,93 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#version 150 core - -#define MAX_LIGHT_NUM 8 - -in vec3 positionWorldspace; -in vec3 normalCameraspace; - -uniform mat4 V; -uniform vec4 materialAmbient; -uniform vec4 materialDiffuse; -uniform vec4 materialSpecular; -uniform vec4 materialColor; -uniform int twoSidesLighting; -uniform float materialShininess; -uniform vec4 lightColor[MAX_LIGHT_NUM]; -uniform vec4 lightPosWorldspace[MAX_LIGHT_NUM]; -uniform float lightPower[MAX_LIGHT_NUM]; -uniform int lightNum; -uniform vec4 lightAmbient; -uniform int undraw; -uniform float minCoordX; - -void main() -{ - if ((positionWorldspace.x <= minCoordX) && (undraw == 1)) - discard; - vec3 colorTotal = vec3(0.0f, 0.0f, 0.0f); - - vec3 vertexPositionCameraspace = (V * vec4(positionWorldspace,1)).xyz; - - vec3 MaterialDiffuseColor = materialColor.rgb; - - vec3 normalDirectionCameraspace = normalCameraspace; - vec3 eyeDirectionCameraspace = normalize(vec3(0, 0, 0) - vertexPositionCameraspace); - float attenuation = 1.0; - int i = 0; - vec3 lightDirectionCameraspace; - vec3 vertexToLightSource; - - vec3 totalAmbient = lightAmbient.rgb * - MaterialDiffuseColor * - materialAmbient.rgb; - - if ((twoSidesLighting == 1) && (!gl_FrontFacing)) - { - normalDirectionCameraspace = -normalDirectionCameraspace; - } - for (i = 0; i < lightNum; i++) - { - float LightPower = lightPower[i]; - lightDirectionCameraspace = normalize((V * lightPosWorldspace[i]).xyz); - - float cosTheta = clamp(dot(normalDirectionCameraspace,lightDirectionCameraspace), 0,1); - vec3 lightDiffuse = LightPower * - attenuation * - lightColor[i].rgb * - MaterialDiffuseColor * - materialDiffuse.rgb * - cosTheta; - - vec3 specularReflection; - if (dot(normalDirectionCameraspace, lightDirectionCameraspace) < 0) - { - specularReflection = vec3(0.0, 0.0, 0.0); - } - else - { - vec3 R = reflect(-lightDirectionCameraspace,normalDirectionCameraspace); - float cosAlpha = clamp(dot(eyeDirectionCameraspace, R), 0,1); - specularReflection = attenuation * - LightPower * - lightColor[i].rgb * - materialSpecular.rgb * - MaterialDiffuseColor * - pow(max(0.0, cosAlpha), materialShininess); - } - colorTotal += lightDiffuse + specularReflection; - - } - colorTotal += totalAmbient; - gl_FragColor = vec4(colorTotal, 1.0); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/opengl/shape3DVertexShader.glsl b/chart2/opengl/shape3DVertexShader.glsl deleted file mode 100644 index 9b763c968e15..000000000000 --- a/chart2/opengl/shape3DVertexShader.glsl +++ /dev/null @@ -1,32 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#version 330 core - -in vec3 vertexPositionModelspace; -in vec3 vertexNormalModelspace; - -out vec3 positionWorldspace; -out vec3 normalCameraspace; - -uniform mat4 P; -uniform mat4 M; -uniform mat4 V; -uniform mat3 normalMatrix; - -void main() -{ - positionWorldspace = (M * vec4(vertexPositionModelspace,1)).xyz; - - gl_Position = P * V * vec4(positionWorldspace,1); - - normalCameraspace = normalize(mat3(V) * normalMatrix * vertexNormalModelspace); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/opengl/shape3DVertexShaderBatch.glsl b/chart2/opengl/shape3DVertexShaderBatch.glsl deleted file mode 100644 index 46a91a23a86b..000000000000 --- a/chart2/opengl/shape3DVertexShaderBatch.glsl +++ /dev/null @@ -1,36 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#version 330 core - -in vec3 vertexPositionModelspace; -in vec3 vertexNormalModelspace; -in mat4 M; -in mat3 normalMatrix; -in vec4 barColor; - -out vec3 positionWorldspace; -out vec3 normalCameraspace; -out vec4 fragBarColor; - -uniform mat4 P; -uniform mat4 V; - -void main() -{ - gl_Position = P * V * M * vec4(vertexPositionModelspace,1); - - positionWorldspace = (M * vec4(vertexPositionModelspace,1)).xyz; - - normalCameraspace = normalize(mat3(V) * normalMatrix * vertexNormalModelspace); - - fragBarColor = barColor; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/opengl/shape3DVertexShaderBatchScroll.glsl b/chart2/opengl/shape3DVertexShaderBatchScroll.glsl deleted file mode 100644 index 2caff6e8d4d3..000000000000 --- a/chart2/opengl/shape3DVertexShaderBatchScroll.glsl +++ /dev/null @@ -1,41 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#version 330 core - -in vec3 vertexPositionModelspace; -in vec3 vertexNormalModelspace; -in mat4 M; -in mat3 normalMatrix; -in vec4 barColor; - -out vec3 positionWorldspace; -out vec3 normalCameraspace; -out vec4 fragBarColor; - -uniform mat4 P; -uniform mat4 V; -uniform mat4 transMatrix; -uniform float minCoordX; -uniform float maxCoordX; - -void main() -{ - positionWorldspace = (transMatrix * M * vec4(vertexPositionModelspace,1)).xyz; - - positionWorldspace.x = clamp(positionWorldspace.x, minCoordX, maxCoordX); - - gl_Position = P * V * vec4(positionWorldspace,1); - - normalCameraspace = normalize(mat3(V) * normalMatrix * vertexNormalModelspace); - - fragBarColor = barColor; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/opengl/shape3DVertexShaderV300.glsl b/chart2/opengl/shape3DVertexShaderV300.glsl deleted file mode 100644 index c5072fd0b55e..000000000000 --- a/chart2/opengl/shape3DVertexShaderV300.glsl +++ /dev/null @@ -1,36 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#version 150 core - -in vec3 vertexPositionModelspace; -in vec3 vertexNormalModelspace; - -out vec3 positionWorldspace; -out vec3 normalCameraspace; - -uniform mat4 P; -uniform mat4 M; -uniform mat4 V; -uniform mat3 normalMatrix; -uniform float minCoordX; -uniform float maxCoordX; - -void main() -{ - positionWorldspace = (M * vec4(vertexPositionModelspace,1)).xyz; - - positionWorldspace.x = clamp(positionWorldspace.x, minCoordX, maxCoordX); - - gl_Position = P * V * vec4(positionWorldspace,1); - - normalCameraspace = normalize(mat3(V) * normalMatrix * vertexNormalModelspace); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/opengl/symbolFragmentShader.glsl b/chart2/opengl/symbolFragmentShader.glsl deleted file mode 100644 index f9b6dfa9b71a..000000000000 --- a/chart2/opengl/symbolFragmentShader.glsl +++ /dev/null @@ -1,101 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#version 150 core - -in vec4 fragmentColor; -uniform int shape; - -void main() -{ - vec2 p = gl_PointCoord * 2.0 - vec2(1.0); // (0,0) in the center - if(shape == 0) - { - } - else if(shape == 1) //diamond - { - if (abs(p.x) + abs(p.y) > 1) - discard; - } - else if(shape == 2) // arrow - { - if(p.y < 0 && (abs(p.x) + abs(p.y)) > 1) - discard; - else if(p.y > 0 && abs(p.x) > 0.5) - discard; - } - else if(shape == 3) //arrow up - { - if(p.y > 0 && (abs(p.x) + abs(p.y)) > 1) - discard; - else if(p.y < 0 && abs(p.x) > 0.5) - discard; - } - else if(shape == 4) // arrow right - { - if(p.x > 0 && (abs(p.x) + abs(p.y)) > 1) - discard; - else if(p.x < 0 && abs(p.y) > 0.5) - discard; - } - else if(shape == 5) // arrow left - { - if(p.x < 0 && (abs(p.x) + abs(p.y)) > 1) - discard; - else if(p.x > 0 && abs(p.y) > 0.5) - discard; - } - else if(shape == 6) // hour glass - { - if(abs(p.x) < abs(p.y)) - discard; - } - else if(shape == 7) // bow tie - { - if(abs(p.y) < abs(p.x)) - discard; - } - else if(shape == 8) // circle - { - if(dot(p.x, p.y) > 1) - discard; - } - else if(shape == 9) // star - { - if(sqrt(abs(p.x))+sqrt(abs(p.y)) > 1) - discard; - } - else if(shape == 10) // X - { - if(abs(abs(p.x) - abs(p.y)) > 0.2) - discard; - } - else if(shape == 11) // Plus - { - if(abs(p.x) > 0.2 && abs(p.y) > 0.2) - discard; - } - else if(shape == 12) // asterisk - { - } - else if(shape == 13) // horizontal bar - { - if(abs(p.y) > 0.2) - discard; - } - else if(shape == 14) // vertical bar - { - if(abs(p.x) > 0.2) - discard; - } - - gl_FragColor = fragmentColor; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/opengl/symbolVertexShader.glsl b/chart2/opengl/symbolVertexShader.glsl deleted file mode 100644 index c5603b5e79d1..000000000000 --- a/chart2/opengl/symbolVertexShader.glsl +++ /dev/null @@ -1,23 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#version 150 core - -in vec3 vPosition; -uniform mat4 MVP; -uniform vec4 vColor; -out vec4 fragmentColor; - -void main() -{ - gl_Position = MVP * vec4(vPosition, 1); - fragmentColor = vColor; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/opengl/textFragmentShader.glsl b/chart2/opengl/textFragmentShader.glsl deleted file mode 100644 index 16be8c6ae0f0..000000000000 --- a/chart2/opengl/textFragmentShader.glsl +++ /dev/null @@ -1,23 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#version 150 core - -uniform sampler2D TextTex; -in vec2 vTexCoord; -out vec4 actualColor; - - -void main() -{ - vec3 color = texture(TextTex, vTexCoord).rgb; - actualColor = vec4(color, 1.0 - color.r); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/opengl/textFragmentShaderBatch.glsl b/chart2/opengl/textFragmentShaderBatch.glsl deleted file mode 100644 index c97812bd0879..000000000000 --- a/chart2/opengl/textFragmentShaderBatch.glsl +++ /dev/null @@ -1,24 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#version 330 core - -#extension GL_EXT_texture_array : enable - -uniform sampler2DArray texArray; -in vec3 vTexCoord; - -out vec4 actualColor; -void main() -{ - vec3 color = texture(texArray, vTexCoord.xyz).rgb; - actualColor = vec4(color, 1.0 - color.r); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/opengl/textVertexShader.glsl b/chart2/opengl/textVertexShader.glsl deleted file mode 100644 index 351da30b5f79..000000000000 --- a/chart2/opengl/textVertexShader.glsl +++ /dev/null @@ -1,22 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#version 150 core - -in vec3 vPosition; -uniform mat4 MVP; -in vec2 texCoord; -out vec2 vTexCoord; -void main() -{ - gl_Position = MVP * vec4(vPosition, 1); - vTexCoord = texCoord; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/opengl/textVertexShaderBatch.glsl b/chart2/opengl/textVertexShaderBatch.glsl deleted file mode 100644 index d5ae4967d345..000000000000 --- a/chart2/opengl/textVertexShaderBatch.glsl +++ /dev/null @@ -1,24 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#version 330 core - -in vec3 vPosition; -in vec3 texCoord; - -out vec3 vTexCoord; -uniform mat4 MVP; - -void main() -{ - gl_Position = MVP * vec4(vPosition, 1); - vTexCoord = texCoord; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |