Skip to content

Commit

Permalink
fix blending
Browse files Browse the repository at this point in the history
  • Loading branch information
slimbuck committed Feb 25, 2025
1 parent 1a317d9 commit cf3464a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/scene/gsplat/gsplat-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ class GSplatData {

/**
* @param {Vec3} result - The result.
* @param {Function} pred - Predicate given index for skipping.
* @param {Function} [pred] - Predicate given index for skipping.
*/
calcFocalPoint(result, pred) {
const x = this.getProp('x');
Expand Down
4 changes: 2 additions & 2 deletions src/scene/gsplat/gsplat-material.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CULLFACE_NONE, SEMANTIC_ATTR13, SEMANTIC_POSITION } from '../../platform/graphics/constants.js';
import { BLEND_NONE, BLEND_NORMAL, DITHER_NONE } from '../constants.js';
import { BLEND_NONE, BLEND_PREMULTIPLIED, DITHER_NONE } from '../constants.js';
import { ShaderMaterial } from '../materials/shader-material.js';
import { shaderChunks } from '../shader-lib/chunks/chunks.js';

Expand Down Expand Up @@ -36,7 +36,7 @@ const createGSplatMaterial = (options = {}) => {
material.setDefine(`DITHER_${ditherEnum.toUpperCase()}`, '');

material.cull = CULLFACE_NONE;
material.blendType = dither ? BLEND_NONE : BLEND_NORMAL;
material.blendType = dither ? BLEND_NONE : BLEND_PREMULTIPLIED;
material.depthWrite = dither;
material.update();

Expand Down
2 changes: 1 addition & 1 deletion src/scene/shader-lib/chunks/gsplat/frag/gsplat.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void main(void) {
opacityDither(alpha, id * 0.013);
#endif
gl_FragColor = vec4(gaussianColor.xyz, alpha);
gl_FragColor = vec4(gaussianColor.xyz * alpha, alpha);
#endif
}
`;

0 comments on commit cf3464a

Please sign in to comment.