3d-texture

Perfect (3D) texture mapping in opengl

大兔子大兔子 提交于 2020-01-09 10:56:48
问题 I am trying to create a simple 3D-array visualisation in opengl. The 3D-array contains color values. To achieve this, I could just draw lots of cubes, giving them texture-coordinates to point to the correct texel. Well, I tried it, and it works. But I need a lot more, and the only way to achieve what I want is if I just draw full 2D planes on every grid in the other axis direction as the plane is on and do this is 6 directions. So for example: I draw XY-plane from -15 to +15, on Z-coordinates

Rendering to a full 3D Render Target in one pass

寵の児 提交于 2019-12-21 02:26:26
问题 Using DirectX 11, I created a 3D volume texture that can be bound as a render target: D3D11_TEXTURE3D_DESC texDesc3d; // ... texDesc3d.Usage = D3D11_USAGE_DEFAULT; texDesc3d.BindFlags = D3D11_BIND_RENDER_TARGET; // Create volume texture and views m_dxDevice->CreateTexture3D(&texDesc3d, nullptr, &m_tex3d); m_dxDevice->CreateRenderTargetView(m_tex3d, nullptr, &m_tex3dRTView); I would now like to update the whole render target and fill it with procedural data generated in a pixel shader, similar

How to keep coordination between particles and which texture pixel contains each one’s information?

别等时光非礼了梦想. 提交于 2019-12-11 15:59:18
问题 Using a 4x4x4 grid as an example, I have 64 vertices (which I’ll call particles) which start with specific positions relative to each other. These 64 particles will move in the x, y and z directions, losing their initial positions relative to each other. However each cycle, the new particle positions and velocities need to be calculated based upon the original starting relationships between a particle and its original neighbors. I’ve learned that I need to use textures, and consequently

Specifying the target layer of a 3D rendertarget in vertex shader? [HLSL]

亡梦爱人 提交于 2019-12-07 14:47:52
问题 When working in HLSL/Directx11 I see there are two methods for binding a 3D rendertarget: either you bind the entire target or you bind it while specifying a layer. If you bind the entire target how does one specify the layer in HLSL code to which the output color is applied? I have a suspicion this requires a geometry shader ... is that correct? Is there any other approach which would allow this to be done in the vertex shader or elsewhere? 回答1: If you bind your whole volume texture (or

3D texture in WebGL/three.js using 2D texture workaround?

谁说我不能喝 提交于 2019-11-28 14:04:58
I would like to use some 3D textures for objects that I'm rendering in WebGL. I'm currently using the following method in a fragment shader, as suggested on WebGL and OpenGL Differences : // tex is a texture with each slice of the cube placed horizontally across the texture. // texCoord is a 3d texture coord // size is the size if the cube in pixels. vec4 sampleAs3DTexture(sampler2D tex, vec3 texCoord, float size) { float sliceSize = 1.0 / size; // space of 1 slice float slicePixelSize = sliceSize / size; // space of 1 pixel float sliceInnerSize = slicePixelSize * (size - 1.0); // space of

Perfect (3D) texture mapping in opengl

自古美人都是妖i 提交于 2019-11-28 11:49:47
I am trying to create a simple 3D-array visualisation in opengl. The 3D-array contains color values. To achieve this, I could just draw lots of cubes, giving them texture-coordinates to point to the correct texel. Well, I tried it, and it works. But I need a lot more, and the only way to achieve what I want is if I just draw full 2D planes on every grid in the other axis direction as the plane is on and do this is 6 directions. So for example: I draw XY-plane from -15 to +15, on Z-coordinates -15 to +15, and do this also for back-XY-plane, YZ-plane, back-YZ-plane, ... This way, I can just put

3D texture in WebGL/three.js using 2D texture workaround?

做~自己de王妃 提交于 2019-11-27 08:03:53
问题 I would like to use some 3D textures for objects that I'm rendering in WebGL. I'm currently using the following method in a fragment shader, as suggested on WebGL and OpenGL Differences: // tex is a texture with each slice of the cube placed horizontally across the texture. // texCoord is a 3d texture coord // size is the size if the cube in pixels. vec4 sampleAs3DTexture(sampler2D tex, vec3 texCoord, float size) { float sliceSize = 1.0 / size; // space of 1 slice float slicePixelSize =