added volume rendering to run on GPU

This commit is contained in:
Evghenii
2013-11-08 13:57:16 +01:00
parent 348100ba42
commit b3c68af40a
10 changed files with 965 additions and 11 deletions

View File

@@ -31,6 +31,17 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef __NVPTX__
#warning "emitting DEVICE code"
#define taskIndex blockIndex0()
#define taskCount blockCount0()
#define programIndex laneIndex()
#define programCount warpSize()
#else
#warning "emitting HOST code"
#endif
typedef float<3> float3;
struct Ray {
@@ -236,7 +247,7 @@ raymarch(uniform float density[], uniform int nVoxels[3], Ray ray) {
// terminate once attenuation is high
float atten = exp(-tau);
if (atten < .005)
cbreak;
break;
// direct lighting
float Li = lightIntensity / distanceSquared(lightPos, pos) *