-
-
Notifications
You must be signed in to change notification settings - Fork 21k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add 3D textures #20597
add 3D textures #20597
Conversation
Great stuff! |
@Zylann the That's how the editor-interface looks like: Juan pushed a commit a day ago to import image files as So any texture you set as the "backend" doesn't have to be uploaded to GPU, so that should help a lot. (If I understood your concerns correctly) |
This could be useful in the medical industry. Stuff like fMRI scans are stored as just a bunch of textures (at least mine were). |
@Two-Tone always a step ahead of you :) |
Sweet. Although I am curious as to what's up with the wobbling in the
texture as the camera rotates.
…On Mon, Jul 30, 2018, 5:03 AM Thomas Herzog ***@***.***> wrote:
@Two-Tone <https://github.com/Two-Tone> always a step ahead of you :)
https://gfycat.com/FluidNeatAfghanhound
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#20597 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEJESx0HsGR-3WnV-LDWh6SJxVSZXfFPks5uLtnzgaJpZM4VmFZy>
.
|
@Two-Tone that's a problem with the shader I had, now I have a better shader that does perspective correction, that was just a Proof-of-concept, don't worry, the 3D texture works fine and has no wobbling :D |
That's great to hear! If I can find my copies of my scans, maybe I'll try
to throw them into Godot and look at them from a tool that doesn't make me
want to tear my eyes out.
…On Mon, Jul 30, 2018, 5:24 AM Thomas Herzog ***@***.***> wrote:
@Two-Tone <https://github.com/Two-Tone> that's a problem with the shader
I had, now I have a better shader that does perspective correction, that
was just a Proof-of-concept, don't worry, the 3D texture works fine and has
no wobbling :D
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#20597 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEJESzCtAccWLq2Oo0RULbnEGk_Yosqnks5uLt7sgaJpZM4VmFZy>
.
|
case ShaderLanguage::TYPE_ISAMPLER2DARRAY: | ||
case ShaderLanguage::TYPE_USAMPLER2DARRAY: | ||
case ShaderLanguage::TYPE_SAMPLER2DARRAY: { | ||
// TODO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice if this is completed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah as I said, I want to add a Texture2DArray
resource later on, just wanted to get this out and it already works if you use the low-level RIDs, but I'll definitely complete thsi! 👍
@@ -1876,3 +1876,209 @@ AnimatedTexture::AnimatedTexture() { | |||
AnimatedTexture::~AnimatedTexture() { | |||
VS::get_singleton()->free(proxy); | |||
} | |||
|
|||
bool Texture3D::get_split_single_image_enabled() const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest you don't do this. A proper importer should be done, instead. Just make texture3D export/load an array of images (so they can be properly compressed if needed). I can handle the importer later if you want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I don't know how to deal with importers, so that would be great!
This PR adds new texture types,
TEXTURE_TYPE_2D_ARRAY
andTEXTURE_TYPE_3D
.The
VisualServer
API is changed slightly to compensate for the new dimensions needed. (@reduz said on IRC that this is acceptable since the servers are rarely used in games and are mostly for internal use)The new types
sampler3D
,isampler3D
,usampler3D
as well assampler2DArray
,isampler2DArray
andusampler2DArray
have been added to the shader language, accompanied by the appropriate accessor functions.A "highlevel" resource type,
Texture3D
has been added that can be used in-editor as a shader parameter by splitting an image into many layers. Via code theTexture3D
can be filled with arbitrary data from differing formats.Later on I will add a
Texture2DArray
highlevel resource type for completion.