opengl-es

Understanding the difference between a 2D texture array and a 3D texture?

时光怂恿深爱的人放手 提交于 2020-12-30 06:11:59
问题 If I understand correctly, if I was to set TEXTURE_MIN_FILTER to NEAREST then there's not much difference between sampler2DArray / TEXTURE_2D_ARRAY and sampler3D / TEXTURE_3D The differences seem to be GenerateMipmap will blend cross layers with 3D textures but not 2D arrays the Z coordinate passed to texture in GLSL is 0 to 1 with 3D textures but an 0 to N (depth) in 2D arrays. If filtering is not NEAREST 3D will blend across layers, 2D array will not. Correct? 回答1: Incorrect. There's one

Understanding the difference between a 2D texture array and a 3D texture?

风格不统一 提交于 2020-12-30 06:10:52
问题 If I understand correctly, if I was to set TEXTURE_MIN_FILTER to NEAREST then there's not much difference between sampler2DArray / TEXTURE_2D_ARRAY and sampler3D / TEXTURE_3D The differences seem to be GenerateMipmap will blend cross layers with 3D textures but not 2D arrays the Z coordinate passed to texture in GLSL is 0 to 1 with 3D textures but an 0 to N (depth) in 2D arrays. If filtering is not NEAREST 3D will blend across layers, 2D array will not. Correct? 回答1: Incorrect. There's one

Understanding the difference between a 2D texture array and a 3D texture?

谁说我不能喝 提交于 2020-12-30 06:06:56
问题 If I understand correctly, if I was to set TEXTURE_MIN_FILTER to NEAREST then there's not much difference between sampler2DArray / TEXTURE_2D_ARRAY and sampler3D / TEXTURE_3D The differences seem to be GenerateMipmap will blend cross layers with 3D textures but not 2D arrays the Z coordinate passed to texture in GLSL is 0 to 1 with 3D textures but an 0 to N (depth) in 2D arrays. If filtering is not NEAREST 3D will blend across layers, 2D array will not. Correct? 回答1: Incorrect. There's one

iPad GLSL. From within a fragment shader how do I get the surface - not vertex - normal

会有一股神秘感。 提交于 2020-12-10 06:33:43
问题 Is it possible to access the surface normal - the normal associated with the plane of a fragment - from within a fragment shader? Or perhaps this can be done in the vertex shader? Is all knowledge of the associated geometry lost when we go down the shader pipeline or is there some clever way of recovering that information in either the vertex of fragment shader? Thanks in advance. Cheers, Doug twitter: @dugla 回答1: You can get per-pixel normals interpolated from vertex normales by just using a

iPad GLSL. From within a fragment shader how do I get the surface - not vertex - normal

本秂侑毒 提交于 2020-12-10 06:31:07
问题 Is it possible to access the surface normal - the normal associated with the plane of a fragment - from within a fragment shader? Or perhaps this can be done in the vertex shader? Is all knowledge of the associated geometry lost when we go down the shader pipeline or is there some clever way of recovering that information in either the vertex of fragment shader? Thanks in advance. Cheers, Doug twitter: @dugla 回答1: You can get per-pixel normals interpolated from vertex normales by just using a

what do texture2D().r and texture2D().a mean?

走远了吗. 提交于 2020-12-10 00:57:53
问题 I am using OpenGL ES in Android programming, when I transform YUV(NV21) to RGB in shader, like: vec3 yuv = vec3( (texture2D(u_TextureY, vTextureCoord).r - 0.0625), texture2D(u_TextureUV, vTextureCoord).a - 0.5, texture2D(u_TextureUV, vTextureCoord).r - 0.5 ); then I'll get YUV data that seperating from u_TextureY and u_TextureUV . I know that NV21 format is like: YYYYYY...UVUV... BUT how can I transform YUYV422 to RGB? So, my problem is what do "r" and "a" mean in texture2D(u_TextureY,

Draw a simple dotted line or dashed line in OpenGL GLES20 android using fragment shader and GL_LINE_STRIP

こ雲淡風輕ζ 提交于 2020-11-29 03:31:10
问题 I went through different sources and seen that we could draw a dotted line using a fragment shader. Because I am new to OpenGL I couldn't able to understand. Can anyone share some code sample that plot dotted or dashed line using fragment shader and GL_LINE_STRIP in Android. References: Dashed line in OpenGL3? Dotted back edges of object 回答1: Line stipple is not supported in OpenGL ES. If you use OpenGL ES 1.00, then you can use the approach which is presented in the answers to OpenGL ES -