texture2d

Rendering SurfaceTexture to Unity Texture2D

旧时模样 提交于 2019-11-29 09:54:31
问题 The bounty expires in 5 days . Answers to this question are eligible for a +50 reputation bounty. Troy Lamerton is looking for a canonical answer : Despite solutions existing, rendering a SurfaceTexture has never been explained properly, or even documented in a github repo. Many people are trying this, none have revealed their code: - https://stackoverflow.com/questions/54224025/surfacetexture-in-android-plugin-doesnt-work-in-unityender - https://github.com/google/ExoPlayer/issues/2040

Vulkan texture rendering on multiple meshes

喜夏-厌秋 提交于 2019-11-29 04:36:52
I am in the middle of rendering different textures on multiple meshes of a model, but I do not have much clues about the procedures. Someone suggested for each mesh, create its own descriptor sets and call vkCmdBindDescriptorSets() and vkCmdDrawIndexed() for rendering like this: // Pipeline with descriptor set layout that matches the shared descriptor sets vkCmdBindPipeline(...pipelines.mesh...); ... // Mesh A vkCmdBindDescriptorSets(...&meshA.descriptorSet... ); vkCmdDrawIndexed(...); // Mesh B vkCmdBindDescriptorSets(...&meshB.descriptorSet... ); vkCmdDrawIndexed(...); However, the above

Texture memory-tex2D basics

江枫思渺然 提交于 2019-11-28 20:49:56
While using texture memory I have come across the following code:- uint f = (blockIdx.x * blockDim.x) + threadIdx.x; uint c = (blockIdx.y * blockDim.y) + threadIdx.y; uint read = tex2D( refTex, c+0.5f, f+0.5f); My question is why do we add 0.5f to both c and f ? This confuses me.. thankyou In graphics, a texture is a set of samples that describes the visual appearance of a surface. A sample is a point. That is, it has no size (as opposed to a pixel that has a physical size). When using samples to determine the colors of pixels, each sample is positioned in the exact center of its corresponding

How can I pass multiple textures to a single shader?

巧了我就是萌 提交于 2019-11-28 17:56:10
I am using freeglut, GLEW and DevIL to render a textured teapot using a vertex and fragment shader. This is all working fine in OpenGL 2.0 and GLSL 1.2 on Ubuntu 14.04. Now, I want to apply a bump map to the teapot. My lecturer evidently doesn't brew his own tea, and so doesn't know they're supposed to be smooth . Anyway, I found a nice-looking tutorial on old-school bump mapping that includes a fragment shader that begins: uniform sampler2D DecalTex; //The texture uniform sampler2D BumpTex; //The bump-map What they don't mention is how to pass two textures to the shader in the first place.

Texture memory-tex2D basics

♀尐吖头ヾ 提交于 2019-11-27 13:14:25
问题 While using texture memory I have come across the following code:- uint f = (blockIdx.x * blockDim.x) + threadIdx.x; uint c = (blockIdx.y * blockDim.y) + threadIdx.y; uint read = tex2D( refTex, c+0.5f, f+0.5f); My question is why do we add 0.5f to both c and f ? This confuses me.. thankyou 回答1: In graphics, a texture is a set of samples that describes the visual appearance of a surface. A sample is a point. That is, it has no size (as opposed to a pixel that has a physical size). When using

How can I pass multiple textures to a single shader?

安稳与你 提交于 2019-11-27 10:54:33
问题 I am using freeglut, GLEW and DevIL to render a textured teapot using a vertex and fragment shader. This is all working fine in OpenGL 2.0 and GLSL 1.2 on Ubuntu 14.04. Now, I want to apply a bump map to the teapot. My lecturer evidently doesn't brew his own tea, and so doesn't know they're supposed to be smooth. Anyway, I found a nice-looking tutorial on old-school bump mapping that includes a fragment shader that begins: uniform sampler2D DecalTex; //The texture uniform sampler2D BumpTex; /

How to make Texture2D Readable via script

不打扰是莪最后的温柔 提交于 2019-11-27 02:06:48
I want to make user able to decode the QR image loaded from the gallery, I have found a plugin to explore and load the image as a texture2D, but to decode that QR code, the Texture2D has to be readable/writable, And I checked the plugin, for Android it's doing the exploring and loading stuff with a jar and in IOS platform it's using a packaged library, so I have no access to the code of the lib, I have searched for the answer, the most solution was to change the importing setting of texture in the Unity inspector, but since this is a texture loaded by code, there is not an inspector setting