Load float array with 3D texture?Why are the GLSL texture-coordinates in my shader not linear?How to bind 2 textures correctlyGLSL Reading From Sampler3d textureopengl 3.1 textures not loadingCreate and use floating point texture in OpenGLOpenGL: Mapping texture on a sphere using spherical coordinatesOpenGL Bindless Textures: Bind to uniform sampler2D arrayWhat am I doing wrong, in regards to multi-texture(OpenGL)?Pass texture with float values to shaderStore array of floats in texture & access the floats from the shader using texture coordinates
Does the app TikTok violate trademark?
Is population size a parameter, or sample size a statistic?
What does it mean by "my days-of-the-week underwear only go to Thursday" in this context?
Create the same subfolders in another folder
お仕事に学校頑張って meaning
Another student has been assigned the same MSc thesis as mine (and already defended)
How fast can a LN payment be over TOR?
Lost passport which have valid student visa but I make new passport unable paste
Can a passenger predict that an airline is about to go bankrupt?
A famous scholar sent me an unpublished draft of hers. Then she died. I think her work should be published. What should I do?
Equations with summation ("sum") symbols
Pushing the e-pawn
Is there a relationship between prime numbers and music?
Whaling ship logistics
Lambda functions with template parameters, not in function parameters
Why aren't faces sharp in my f/1.8 portraits even though I'm carefully using center-point autofocus?
Knights and Knaves: What does C say?
Assembly of PCBs containing a mix of SMT and thru-hole parts?
How to justify getting additional team member when the current team is doing well?
Why does C++ have 'Undefined Behaviour' and other languages like C# or Java don't?
Why does my browser attempt to download pages from http://clhs.lisp.se instead of viewing them normally?
Is there a list of world wide upcoming space events on the web?
An impressive body of work
Where to find the Arxiv endorsement code?
Load float array with 3D texture?
Why are the GLSL texture-coordinates in my shader not linear?How to bind 2 textures correctlyGLSL Reading From Sampler3d textureopengl 3.1 textures not loadingCreate and use floating point texture in OpenGLOpenGL: Mapping texture on a sphere using spherical coordinatesOpenGL Bindless Textures: Bind to uniform sampler2D arrayWhat am I doing wrong, in regards to multi-texture(OpenGL)?Pass texture with float values to shaderStore array of floats in texture & access the floats from the shader using texture coordinates
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
i have a float array with intensity value, i need load this array as 3d texture in opengl, and in the fragment shader read this as red color (float sample= texture(cord,volumeText).r
).
the size of array is 256*256*256, and the intensity value are between 0.0 to 256.0.
this is a sample of intensity values:
75.839354473071637,
64.083049468866022,
65.253933716444365,
79.992431196592577,
84.411485976957096,
0.0000000000000000,
82.020319431382831,
76.808403454586994,
79.974774618246158,
0.0000000000000000,
91.127273013466336,
84.009956557448433,
90.221356094672814,
87.567422484025627,
71.940263118478072,
0.0000000000000000,
0.0000000000000000,
74.487058398181944,
..................,
..................
opengl glsl textures
add a comment
|
i have a float array with intensity value, i need load this array as 3d texture in opengl, and in the fragment shader read this as red color (float sample= texture(cord,volumeText).r
).
the size of array is 256*256*256, and the intensity value are between 0.0 to 256.0.
this is a sample of intensity values:
75.839354473071637,
64.083049468866022,
65.253933716444365,
79.992431196592577,
84.411485976957096,
0.0000000000000000,
82.020319431382831,
76.808403454586994,
79.974774618246158,
0.0000000000000000,
91.127273013466336,
84.009956557448433,
90.221356094672814,
87.567422484025627,
71.940263118478072,
0.0000000000000000,
0.0000000000000000,
74.487058398181944,
..................,
..................
opengl glsl textures
It is not exactly clear what precision requirements you have.
– derhass
Mar 28 at 20:27
add a comment
|
i have a float array with intensity value, i need load this array as 3d texture in opengl, and in the fragment shader read this as red color (float sample= texture(cord,volumeText).r
).
the size of array is 256*256*256, and the intensity value are between 0.0 to 256.0.
this is a sample of intensity values:
75.839354473071637,
64.083049468866022,
65.253933716444365,
79.992431196592577,
84.411485976957096,
0.0000000000000000,
82.020319431382831,
76.808403454586994,
79.974774618246158,
0.0000000000000000,
91.127273013466336,
84.009956557448433,
90.221356094672814,
87.567422484025627,
71.940263118478072,
0.0000000000000000,
0.0000000000000000,
74.487058398181944,
..................,
..................
opengl glsl textures
i have a float array with intensity value, i need load this array as 3d texture in opengl, and in the fragment shader read this as red color (float sample= texture(cord,volumeText).r
).
the size of array is 256*256*256, and the intensity value are between 0.0 to 256.0.
this is a sample of intensity values:
75.839354473071637,
64.083049468866022,
65.253933716444365,
79.992431196592577,
84.411485976957096,
0.0000000000000000,
82.020319431382831,
76.808403454586994,
79.974774618246158,
0.0000000000000000,
91.127273013466336,
84.009956557448433,
90.221356094672814,
87.567422484025627,
71.940263118478072,
0.0000000000000000,
0.0000000000000000,
74.487058398181944,
..................,
..................
opengl glsl textures
opengl glsl textures
edited Mar 28 at 19:36
Rabbid76
61.1k14 gold badges40 silver badges73 bronze badges
61.1k14 gold badges40 silver badges73 bronze badges
asked Mar 28 at 19:00
sebastian pintosebastian pinto
296 bronze badges
296 bronze badges
It is not exactly clear what precision requirements you have.
– derhass
Mar 28 at 20:27
add a comment
|
It is not exactly clear what precision requirements you have.
– derhass
Mar 28 at 20:27
It is not exactly clear what precision requirements you have.
– derhass
Mar 28 at 20:27
It is not exactly clear what precision requirements you have.
– derhass
Mar 28 at 20:27
add a comment
|
1 Answer
1
active
oldest
votes
To load a texture like this you can use the input format GL_RED
and type GL_FLOAT
. A proper sized internal format for is GL_R16F
. See glTexImage3D
:
glTexImage3D(GL_TEXTURE_3D, 0, GL_R16F, 256, 256, 256, 0, GL_RED, GL_FLOAT, dataPtr)
The internal format GL_R16F
is a floating point format. This means when you read the red color channel (.r
) from the texture in the fragment shader, then the values are still in range [0.0, 256.0].
add a comment
|
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55405064%2fload-float-array-with-3d-texture%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
To load a texture like this you can use the input format GL_RED
and type GL_FLOAT
. A proper sized internal format for is GL_R16F
. See glTexImage3D
:
glTexImage3D(GL_TEXTURE_3D, 0, GL_R16F, 256, 256, 256, 0, GL_RED, GL_FLOAT, dataPtr)
The internal format GL_R16F
is a floating point format. This means when you read the red color channel (.r
) from the texture in the fragment shader, then the values are still in range [0.0, 256.0].
add a comment
|
To load a texture like this you can use the input format GL_RED
and type GL_FLOAT
. A proper sized internal format for is GL_R16F
. See glTexImage3D
:
glTexImage3D(GL_TEXTURE_3D, 0, GL_R16F, 256, 256, 256, 0, GL_RED, GL_FLOAT, dataPtr)
The internal format GL_R16F
is a floating point format. This means when you read the red color channel (.r
) from the texture in the fragment shader, then the values are still in range [0.0, 256.0].
add a comment
|
To load a texture like this you can use the input format GL_RED
and type GL_FLOAT
. A proper sized internal format for is GL_R16F
. See glTexImage3D
:
glTexImage3D(GL_TEXTURE_3D, 0, GL_R16F, 256, 256, 256, 0, GL_RED, GL_FLOAT, dataPtr)
The internal format GL_R16F
is a floating point format. This means when you read the red color channel (.r
) from the texture in the fragment shader, then the values are still in range [0.0, 256.0].
To load a texture like this you can use the input format GL_RED
and type GL_FLOAT
. A proper sized internal format for is GL_R16F
. See glTexImage3D
:
glTexImage3D(GL_TEXTURE_3D, 0, GL_R16F, 256, 256, 256, 0, GL_RED, GL_FLOAT, dataPtr)
The internal format GL_R16F
is a floating point format. This means when you read the red color channel (.r
) from the texture in the fragment shader, then the values are still in range [0.0, 256.0].
answered Mar 28 at 19:32
Rabbid76Rabbid76
61.1k14 gold badges40 silver badges73 bronze badges
61.1k14 gold badges40 silver badges73 bronze badges
add a comment
|
add a comment
|
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55405064%2fload-float-array-with-3d-texture%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
It is not exactly clear what precision requirements you have.
– derhass
Mar 28 at 20:27