Skip to content

Use transparent material params for alpha transparent textures #7

@deathcap

Description

@deathcap

voxel-texture creates a MeshFaceMaterial with two materials:

this.material = new this.THREE.MeshFaceMaterial([
  opaque,
  transparent
]);

and uses the first if !isTransparent, second otherwise. They only differ in that transparent: true is set in the material parameters.

voxel-texture-shader always uses the first material, with transparent: false, so it cannot handle alpha transparency. However the vertex shader does include:

'   if (gl_FragColor.a < 0.001) discard; // transparency',

for full transparency (glass), but it won't work for, e.g., water.

Should restore the secondary transparent material parameters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions