Closed VanderSP closed 3 years ago
tried to change this part
' vec4 AlphaMap = texture2D(alphaSampler, vUv);',
' float AlphaChannel = AlphaMap.r;',
' gl_FragColor = vec4( outgoingLight, AlphaChannel );',
/* ' gl_FragColor.a *= texture2D( alphaSampler, vUv );', */
now it compiles, but the ocean is kinda whitey now, i dunno if it was my alphamap gradient i tried lol!
hmm even if i got this working one day (lol, glsl is hard), how can i change the offset, like alphaMap.offset.position.y for example...
Thanks one more time... i hope not disturb you!
edit: i´ve got whitey ocean but no errors, with this:
' gl_FragColor = vec4( outgoingLight, alpha );', ' vec4 AlphaMap = texture2D(alphaSampler, vUv);', ' gl_FragColor.a = AlphaMap.r;',
im doing something wrong haha
i think i´ve uma idea, a hack to create mask using canvas... i did in the past... i tried to use canvas material transparent, i got it working in one case, but in this case, i think it don´t work... hmm if alphamap is hard on water, maybe some global fog is possible? from high altitude is very bad the ocean horizon not fading out...
strange, in mirrorshader theres fog settings... i can put any color cool, but there´s how to make de fog produce alpha? i think it would be the best path... no map needed...
solved with:
' gl_FragColor.a *= smoothstep(.99995, .9895,gl_FragCoord.z);',
and material.transparent=true
tried to implement that alphamap on water... and got this haha
ERROR: 0:185: 'assign' : cannot convert from 'highp 4-component vector of float' to 'highp float'