Hi there,
I’m trying to get a custom shader to have semi-transparency. I’ve actually gotten this to work in the past but for some reason it’s no longer working for me. Things I’ve tried:
enabling material.alphaWrite,
enabling alphaToCoverage,
fiddling with alphaTest value,
enabling material.blend,
trying different blendTypes including Blend_Normal.
Here is my current code which has worked in other projects but doesn’t seem to work here:
this.material = new pc.Material();
this.material.shader = this.shader;
if(this.enableTransparency){
this.material.alphaWrite = true;
this.material.alphaToCoverate = true;
this.material.alphaTest = 0.0;
this.material.blend = true;
this.material.blendSrc = pc.gfx.BLENDMODE_SRC_ALPHA;
this.material.blendDst = pc.gfx.BLENDMODE_ONE_MINUS_SRC_ALPHA;
}
this.material.update();
Additionally, in my custom shader I just set the alpha value of gl_FragColor to 0.5 for testing purposes, no matter what I seem to try, the object is completely invisible.