Skip to content
Snippets Groups Projects
Commit 3cb9d101 authored by Alexander Rose's avatar Alexander Rose
Browse files

fix shader tests & cleanup shader code

parent 23c53cd9
No related branches found
No related tags found
No related merge requests found
......@@ -13,7 +13,7 @@ export const wboit_write = `
}
} else if (uRenderWboit) {
// the 'fragmentDepth > 0.99' check is to handle precision issues with packed depth
if (preFogAlpha != 1.0 && (!interior || uDoubleSided) && (fragmentDepth < getDepth(gl_FragCoord.xy / uDrawingBufferSize) || fragmentDepth > 0.99)) {
if (preFogAlpha != 1.0 && (fragmentDepth < getDepth(gl_FragCoord.xy / uDrawingBufferSize) || fragmentDepth > 0.99)) {
float alpha = gl_FragColor.a;
float wboitWeight = alpha * clamp(pow(1.0 - fragmentDepth, 2.0), 0.01, 1.0);
gl_FragColor = vec4(gl_FragColor.rgb * alpha * wboitWeight, alpha);
......
......@@ -72,12 +72,7 @@ uniform float uPickingAlphaThreshold;
uniform bool uTransparentBackground;
uniform float uXrayEdgeFalloff;
uniform float uInteriorDarkening;
uniform bool uInteriorColorFlag;
uniform vec3 uInteriorColor;
uniform bool uRenderWboit;
uniform bool uDoubleSided;
uniform float uNear;
uniform float uFar;
......@@ -357,7 +352,6 @@ void main() {
float fragmentDepth = calcDepth((uModelView * vec4(start, 1.0)).xyz);
float preFogAlpha = clamp(preFogAlphaBlended, 0.0, 1.0);
bool interior = false;
#include wboit_write
}
`;
\ No newline at end of file
/**
* Copyright (c) 2020-2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
* Copyright (c) 2020-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*/
......@@ -99,7 +99,6 @@ void main() {
if (imageData.a > 0.9) imageData.a = 1.0;
float fragmentDepth = gl_FragCoord.z;
bool interior = false;
#if defined(dRenderVariant_pick)
if (imageData.a < 0.3)
......
/**
* Copyright (c) 2018-2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
* Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*/
......@@ -16,7 +16,6 @@ precision highp int;
void main(){
#include clip_pixel
bool interior = false;
float fragmentDepth = gl_FragCoord.z;
#include assign_material_color
......
/**
* Copyright (c) 2018-2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
* Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*/
......@@ -20,7 +20,6 @@ void main(){
#include clip_pixel
float fragmentDepth = gl_FragCoord.z;
bool interior = false;
#include assign_material_color
#if defined(dPointStyle_circle)
......
/**
* Copyright (c) 2019-2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
* Copyright (c) 2019-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*/
......@@ -33,7 +33,6 @@ void main(){
#include clip_pixel
float fragmentDepth = gl_FragCoord.z;
bool interior = false;
#include assign_material_color
if (vTexCoord.x > 1.0) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment