Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions src/scene/shader-lib/glsl/chunks/standard/frag/stdDeclaration.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@ export default /* glsl */`
// globals
float dAlpha = 1.0;

#if defined(LIT_ALPHA_TEST)
#include "alphaTestPS"
#endif

// dithering
#if STD_OPACITY_DITHER != NONE
#include "opacityDitherPS"
// all passes handle opacity
#if LIT_BLEND_TYPE != NONE || defined(LIT_ALPHA_TEST) || defined(LIT_ALPHA_TO_COVERAGE) || STD_OPACITY_DITHER != NONE
#ifdef STD_OPACITY_TEXTURE_ALLOCATE
uniform sampler2D texture_opacityMap;
#endif
#endif

#ifdef FORWARD_PASS // ----------------
Expand Down
12 changes: 9 additions & 3 deletions src/scene/shader-lib/glsl/chunks/standard/frag/stdFrontEnd.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@ export default /* glsl */`

// all passes handle opacity
#if LIT_BLEND_TYPE != NONE || defined(LIT_ALPHA_TEST) || defined(LIT_ALPHA_TO_COVERAGE) || STD_OPACITY_DITHER != NONE
#ifdef STD_OPACITY_TEXTURE_ALLOCATE
uniform sampler2D texture_opacityMap;
#endif
#include "opacityPS"

#if defined(LIT_ALPHA_TEST)
#include "alphaTestPS"
#endif

// dithering
#if STD_OPACITY_DITHER != NONE
#include "opacityDitherPS"
#endif
#endif

#ifdef FORWARD_PASS // ----------------
Expand Down
13 changes: 6 additions & 7 deletions src/scene/shader-lib/wgsl/chunks/standard/frag/stdDeclaration.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ export default /* wgsl */`
// globals
var<private> dAlpha: f32 = 1.0;

#if defined(LIT_ALPHA_TEST)
#include "alphaTestPS"
#endif

// dithering
#if STD_OPACITY_DITHER != NONE
#include "opacityDitherPS"
// all passes handle opacity
#if LIT_BLEND_TYPE != NONE || defined(LIT_ALPHA_TEST) || defined(LIT_ALPHA_TO_COVERAGE) || STD_OPACITY_DITHER != NONE
#ifdef STD_OPACITY_TEXTURE_ALLOCATE
var texture_opacityMap : texture_2d<f32>;
var texture_opacityMapSampler : sampler;
#endif
#endif

#ifdef FORWARD_PASS // ----------------
Expand Down
13 changes: 9 additions & 4 deletions src/scene/shader-lib/wgsl/chunks/standard/frag/stdFrontEnd.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@ export default /* wgsl */`

// all passes handle opacity
#if LIT_BLEND_TYPE != NONE || defined(LIT_ALPHA_TEST) || defined(LIT_ALPHA_TO_COVERAGE) || STD_OPACITY_DITHER != NONE
#ifdef STD_OPACITY_TEXTURE_ALLOCATE
var texture_opacityMap : texture_2d<f32>;
var texture_opacityMapSampler : sampler;
#endif
#include "opacityPS"

#if defined(LIT_ALPHA_TEST)
#include "alphaTestPS"
#endif

// dithering
#if STD_OPACITY_DITHER != NONE
#include "opacityDitherPS"
#endif
#endif

#ifdef FORWARD_PASS // ----------------
Expand Down