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
5
votes
1 answer

DirectX 11 - How to create a very simple 2D texture

I am very new to Direct X 11. I want to create a simple 2d texture (of type ID3D11Texture2D). I have read document about CreateTexture2D and I understand that: pDesc is how we define the image. pInitialData contains the array of bytes presents…
123iamking
  • 2,387
  • 4
  • 36
  • 56
5
votes
1 answer

OpenGL loading binds the last loaded texture to all textureID's

So my problem is that I try to load multiple textures at start up and then store all of the ID's so that I can bind them to use them. Now I know that the ID's are being stored correctly because I can debug it and see in both assigning and usage that…
Hewiiitt
  • 306
  • 1
  • 12
5
votes
1 answer

texture2D not compatible with Compute Shaders on android mobile phone?

I am trying to use texture2D() to read a value from a sampler2d texture in a compute shader. On PC it is working fine, but on a android mobile device (using version 310 es) the compilation for the same code fails with the folowing error: 'texture2D'…
markwalberg
  • 311
  • 2
  • 10
5
votes
2 answers

Unity Texture2D create rounded corners

I am making a game in unity and am having this issue. The users can upload an profile image from there device to my backenserver to personalize there account. This part is working just fine, but... The picture is square rectangle but I would like…
Mansa
  • 2,277
  • 10
  • 37
  • 67
5
votes
1 answer

What is the correct Resource.Load path?

I'm trying to load a Texture2D (.png) resource using Resource.Load. I've tried following path…
Tomáš Zato
  • 50,171
  • 52
  • 268
  • 778
5
votes
2 answers

(Texture2D) t1 = t2; Does it creates reference or a copy?

Quick question. (I was not able to find documentation about this anywhere) When you do this: Texture2D t1; t1 = content.Load("some texture"); Texture2D t2; t2 = t1; Does it creates a reference or actually copies the texture? I would…
NewProger
  • 2,945
  • 9
  • 40
  • 58
5
votes
2 answers

Images are not displayed and showing error like "cocos2d: CCTexture2D: Using RGB565 texture since image has no alpha"

I am making an application using Box2D in which i am getting images from Asset Library and displaying them as sprites. here is the code which i have done : Getting Images from asset library : CGImageRef imgRef = [[mutArrAssetPhotos objectAtIndex:i]…
Mansi Panchal
  • 2,357
  • 18
  • 27
4
votes
1 answer

Converting byte array into texture2D XNA

I have a byte array representing an image. Each byte represents an intensity value (0-255) of either R,G or B of a particular pixel. So for a 640x480 image the byte array is of size 640*480*3 (each pixel has 3 bytes representing it). The bytes are…
Jkh2
  • 1,010
  • 1
  • 13
  • 25
4
votes
1 answer

EncodeToPNG hangs the script

What I want is to read png file as byte[] array. I need that array in order to send it to the remote server via HTTP POST request. My code looks like this: Sprite sprite = Resources.Load("Images/" + _filename); print("Sprite…
Makalele
  • 7,431
  • 5
  • 54
  • 81
4
votes
1 answer

How to resize a Texture2D using height and width?

i tried to resize the texture with size and width and its showing index out of width/height the texture need to be resized because i'm using it on other texture to apply on particular co-ordinates so i'm not able to resize the texture graphics is my…
4
votes
1 answer

How convert type 'UnityEngine.Texture2D' to 'UnityEngine.Sprite?

Hi i try to convert my Texture 2D in Image (and i cant use a Raw Image because the resolution dont match in phones) but the problem is that Image does not have the Texture element. how Convert UnityEngine.Texture2D in Image.Sprite. //Image…
4
votes
1 answer

How can I use a .bmp file and create a Texture in Unity at runtime?

I'm working in a Unity Project where the user choose image files (in .bmp format) that is used to make a Texture2D and pasted to a model, I create the next code, I work fine with .png and .jpg file, but when I try load .bmp I got only a (I assume)…
Eduardo Corona
  • 1,262
  • 4
  • 20
  • 31
4
votes
2 answers

RenderTexture to Texture2D is very slowly

We develop an application on Unity3D which shall take the image from the screen and transfer it to Texture2D. We have difficulties with performance on everage (feeble) devices. The code is given below. We do a screenshot, then we read pixels…
4
votes
1 answer

Procedural Textures in Unity?

I am mainly a programmer, not very good at drawing, so I decided to make textures at run time in a procedural way and by that I mean to generate something new and fresh every time at the same time it should look believable.How to get Started with…
4
votes
1 answer

screenshot capture and display

I'm creating an application where i want to be able to store a screenshot, and then display it afterwards. My code is running fine, the screenshot is stored and seemingly also received by the program without a problem. However, it is not displaying…
1 2
3
43 44