Twinklebear / webgl-volume-raycaster

A WebGL Volume Raycaster

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The simplest way to do it

kt7456 opened this issue · comments

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)

Originally posted by @Twinklebear in #6 (comment)

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

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: