timscaffidi / ofxVolumetrics

Simple volumetric rendering addon for openFrameworks.
Other
53 stars 15 forks source link

iterate slices of the volume / load iterated slices into volume #9

Open Jonathhhan opened 3 years ago

Jonathhhan commented 3 years ago

hi, i iterate slices of the volume with a shader for a game of life app. i loop the slices of the volume, which works well. the only thing is that it hangs for one frame at the end of the volume / loop. perhaps because there is a background fbo for the last slice of the volume (actually the first and the last slice of the 3d texture is not shown)?

second question: is it possible to load the shader output back into the volume without passing the data to the cpu (with ofPixels)? this is the uploading part of my code:

... a.gameOfLifeFbo:beginFbo(); ofClear(0); ofDrawRectangle(0, 0, a.volWidth, a.volHeight); a.gameOfLifeFbo:endFbo(); a.gameOfLifeFbo:readToPixels(a.gameOfLifePixels); a.gameOfLifeShader:endShader(); a.texture3d:loadVolumeData(a.gameOfLifePixels:getData(), a.volWidth, a.volHeight, 1, 0, 0, a.depthCounter); a.gameOfLifePixels:clear(); ...

kind regards, jonathan