You can address one slice of the 3D texture by playing with the 3D texture coordinates values (which I will refer to as the (u, v, w) coordinates) For example, let's say you want to get the slices along the Z axis. Imagine that your 3D texture lives a unit cube in the 3D world. The coordinates (u, v, 0) will yield the texels of the first slice (u, v, 0.5) will yield the texels in the middle of the volume and (u, v, 1.0) the texels of the last slice A first slicing shader would look like this : slicer.Cg //------------------------------------------------------------------------------ struct AppData { float3 position : POSITION; float3 normal : NORMAL; float3 texcoord : TEXCOORD0; }; struct VertexOutput { float4 position : POSITION; float3 texcoord : TEXCOORD0; }; //------------------------------------------------------------------------------ VertexOutput main_vp( AppData IN , uniform float4 slice , uniform float4x4 worldViewProj) { VertexOutput OUT; OUT.
Position = mul(worldViewProj, float4(IN. Position, 1)); OUT. Texcoord = float3(IN.texcoord.
Xy, slice. X); return OUT; } //------------------------------------------------------------------------------ void main_fp( float3 texcoord : TEXCOORD0 , out float3 oColor : COLOR , uniform sampler3D volume) { float val = tex3D(volume, texcoord). A; oColor = float3(1.0, 0.0, 0.0) ; } In this example, the slice index along the Z axis is passed through a uniform variable ( float4 slice ), in the vertex shader (main_vp) The (u, v) texture coordinates are defined in a mesh (in this case, it would be a simple 2D quad), interpolated by the GPU, and used in the fragment shader ( main_fp ) I'm not sure what you're trying to achieve by accessing the previous slice, but again, you can do it by recomputing the w value in the shader and resampling the the 3D texture Of course, you could cut your cube along another axis, or even with an arbitrary plane, but that last one would need a little more math to get the 3 (u, v, w) coordinates.
You can address one slice of the 3D texture by playing with the 3D texture coordinates values (which I will refer to as the (u, v, w) coordinates). For example, let's say you want to get the slices along the Z axis. Imagine that your 3D texture lives a unit cube in the 3D world.
The coordinates (u, v, 0) will yield the texels of the first slice. (u, v, 0.5) will yield the texels in the middle of the volume and (u, v, 1.0), the texels of the last slice. A first slicing shader would look like this : // slicer.Cg //------------------------------------------------------------------------------ struct AppData { float3 position : POSITION; float3 normal : NORMAL; float3 texcoord : TEXCOORD0; }; struct VertexOutput { float4 position : POSITION; float3 texcoord : TEXCOORD0; }; //------------------------------------------------------------------------------ VertexOutput main_vp( AppData IN , uniform float4 slice , uniform float4x4 worldViewProj) { VertexOutput OUT; OUT.
Position = mul(worldViewProj, float4(IN. Position, 1)); OUT. Texcoord = float3(IN.texcoord.
Xy, slice. X); return OUT; } //------------------------------------------------------------------------------ void main_fp( float3 texcoord : TEXCOORD0 , out float3 oColor : COLOR , uniform sampler3D volume) { float val = tex3D(volume, texcoord). A; oColor = float3(1.0, 0.0, 0.0) ; } In this example, the slice index along the Z axis is passed through a uniform variable (float4 slice), in the vertex shader (main_vp).
The (u, v) texture coordinates are defined in a mesh (in this case, it would be a simple 2D quad), interpolated by the GPU, and used in the fragment shader (main_fp) I'm not sure what you're trying to achieve by accessing the previous slice, but again, you can do it by recomputing the w value in the shader and resampling the the 3D texture. Of course, you could cut your cube along another axis, or even with an arbitrary plane, but that last one would need a little more math to get the 3 (u, v, w) coordinates.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.