The simplest way to do it (ie avoiding modifying the volume renderer) would be to have the volume raycaster render the image to an RGBA texture the same size as the canvas. Then you'd draw a quad on top of the mapbox rendering to display this texture, and just invert the y coordinates when you sample values from the texture to flip it upside down. When you render the quad you want to set the blending mode so that it'll blend over the mapbox image properly (src factor ONE and dst factor ONE_MINUS_SRC_ALPHA)
I don't have time to dig into your code, to learn how to do the rendering to texture and flipping of the image check out some WebGL and computer graphics courses:
The simplest way to do it (ie avoiding modifying the volume renderer) would be to have the volume raycaster render the image to an RGBA texture the same size as the canvas. Then you'd draw a quad on top of the mapbox rendering to display this texture, and just invert the y coordinates when you sample values from the texture to flip it upside down. When you render the quad you want to set the blending mode so that it'll blend over the mapbox image properly (src factor
ONE
and dst factorONE_MINUS_SRC_ALPHA
)Originally posted by @Twinklebear in https://github.com/Twinklebear/webgl-volume-raycaster/issues/6#issuecomment-1244866382
Can you help me modify it , I don't know how to modify it,thanks! this is other demo address http://animpen.com/pen/kfpPAJa7 this is old demo address https://plnkr.co/edit/zdKhXxpkDkgIThfm?preview Requires google browser to open