Questions tagged [texture2d]

Texture2D is a class in used to handle textures. The class allows to edit existing texture assets or to create new textures on the fly.

Texture2D documentation

661 questions
39
votes
2 answers

How can I pass multiple textures to a single shader?

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…
lofidevops
  • 15,528
  • 14
  • 79
  • 119
18
votes
1 answer

What is the difference between glBindImageTexture() and glBindTexture()?

What is the difference between glBindImageTexture and glBindTexture? And also what is the difference between the following declarations in a shader: layout (binding = 0, rgba32f) uniform image2D img_input; and uniform sampler2D img_input;
markwalberg
  • 311
  • 2
  • 10
15
votes
3 answers

Non-blocking loading and copying of large Texture2D's in C# for Unity

I'm building a Unity app for Android which deals with loading a lot of large textures dynamically (all images are over 6MB in size as png's). These textures can either come from an Amazon S3 server, in which case they arrive as a stream, or from the…
Arthur
  • 598
  • 1
  • 7
  • 18
14
votes
2 answers

Making a Texture2D readable in Unity via code

I have some AssetBundles that I want to convert to .png image files. They are Texture2D assets, but the problem is as they are not Read Enable, when I try to convert them to PNG with a var _bytes = _texture2d.EncodeToPNG(); command, I get the…
DavidGuaita
  • 501
  • 1
  • 7
  • 18
14
votes
2 answers

glTexImage2d and Null data

This is a weird question but I was wondering why glTexImage2d cares about the pixel data type and format of Null data. The signature for glTexImage2d is... void glTexImage2D( GLenum target, GLint level, GLint internalFormat, GLsizei…
Ryan Bartley
  • 606
  • 8
  • 17
12
votes
4 answers

Is there a fast alternative to creating a Texture2D from a Bitmap object in XNA?

I've looked around a lot and the only methods I've found for creating a Texture2D from a Bitmap are: using (MemoryStream s = new MemoryStream()) { bmp.Save(s, System.Drawing.Imaging.ImageFormat.Png); s.Seek(0, SeekOrigin.Begin); Texture2D…
Matthew Bowen
  • 469
  • 1
  • 4
  • 16
12
votes
1 answer

Combine Array of Sprite objects into One Sprite - Unity

I have an array of Sprite objects in Unity. Their size vary depending on the image loaded. I want to combine them side by side like a tiled map into one image. I want them to be layout like your are forming a line of images, one after the other.…
cessmestreet
  • 2,298
  • 3
  • 22
  • 42
11
votes
1 answer

XNA draw / paint onto a Texture2D at runtime

Morning all (if its morning where you are) I have been looking around and have not seen a satisfactory method for doing this so thought I would ask around... Ideal world I would like to be able to generate a transparent Texture2D object. Drawing…
Nick
  • 948
  • 2
  • 12
  • 24
10
votes
2 answers

Vulkan texture rendering on multiple meshes

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…
Michael Wei
  • 185
  • 2
  • 10
10
votes
3 answers

Rendering SurfaceTexture to Unity Texture2D

I came up with simillar questions earlier, but they weren't good clarified and right now I would like to take an advice what's wrong I'm doing in my code. So what I'm trying to do is rendering SurfaceTexture from Android plugin to Unity…
Eugene Alexeev
  • 1,152
  • 12
  • 32
10
votes
2 answers

Texture memory-tex2D basics

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…
Code_Jamer
  • 913
  • 2
  • 9
  • 21
9
votes
3 answers

After Writing to a RenderTarget, How to Efficiently Clone the Output?

XNA noob here, learning every day. I just worked out how to composite multiple textures into one using a RenderTarget2D. However, while I can use the RenderTarget2D as a Texture2D for most purposes, there's a critical difference: these rendered…
user565869
9
votes
1 answer

How to make Texture2D Readable via script

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…
armnotstrong
  • 8,605
  • 16
  • 65
  • 130
9
votes
1 answer

'texture2D' : No matching overloaded function found OpenGL ES2?

I was working on a project, and for that project I had to walk through a book called "OpenGL ES 2 For Android: A quick start guide". So when I got to texturing, I got the error of: 'texture2D' : No matching overloaded function found ...when I…
LessComplexity
  • 470
  • 2
  • 5
  • 14
9
votes
1 answer

How to use texture buffers to read a single integer instead of vec4

I have a working code where I am reading vec4 values in the shader from a texture buffer. On the client side, I create a buffer of displacement vectors: vec4 vector1 : vec4(x1, y1, z1, w1); vec4 vector2 : vec4(x2, y2, z2, w2); vec4 vector3 :…
viktorzeid
  • 1,521
  • 1
  • 22
  • 35
1
2 3
43 44