Questions tagged [texture2d]

The tag has no usage guidance, but it has a tag wiki.

texture2d
Filter by
Sorted by
Tagged with
0 votes
1 answer
159 views

Memory management issues in Unity3d

Im calling Texture2D function on void OnGUI().And Im adding 5 prefabs in 5 seconds and those are destroying in 20 seconds. This all prefabs using Texture2D. I'm not destroying Texture after use. When ...
Sajitha Rathnayake's user avatar
0 votes
1 answer
166 views

How should I pass a Texture2D as a parameter?

I'm making a game in C# and XNA and I want to use a Texture2D as a parameter in a class constructor. Which of the following methods should I use? 1. //Load the texture as a variable and then pass it ...
Ben's user avatar
  • 1,309
0 votes
1 answer
699 views

How does glsl's texture2d command work with GL_LINEAR textures

I am not sure how exactly the texture2D command works in GLSL with linear filtering. How does it choose and linearly interpolate between pixels. Imagine I had a texture with 4 grayscale pixels of ...
user3758015's user avatar
0 votes
1 answer
204 views

Java JOGL textured object not translating

I have been attempting to use JOGL in a standalone Java app. I have done work with OpenGLES on Android and just ported my code from Android OpenGL to this Java app. There have been some syntax changes ...
itgeek25's user avatar
  • 203
0 votes
1 answer
183 views

How do I send a float 1 component texture to the GPU?

In WebGL I am trying to send a float 1 component texture to the GPU: var array = new Float32Array(4096*4096); // ... read array from file var float_texture_ext = gl.getExtension('OES_texture_float');...
Andy's user avatar
  • 3,539
0 votes
1 answer
994 views

OpenGL texture doesn't load properly

I'm working with Xcode 7.0 on OSX 10.10.5 and I get a very strange result when I try to draw a texture on a square: The image I'm trying to draw is: I've bee looking for quite a while and haven't ...
cohenadair's user avatar
  • 2,072
0 votes
1 answer
2k views

How to get the DirectX::Image (from DirectXTex) structure based on ID3D11Texture2D?

I have an custom texture class: class Texture{ ID3D11Texture2D * renderTargetTexture; public: ... void saveToTGA(std::wstring filePath); }; I am using this texture as render target ...
PolGraphic's user avatar
  • 3,293
0 votes
0 answers
69 views

How do I rotate a Texture2D twice?

I have a Texture2D in C# and XNA. I need to rotate it once around one point and then again around another. If I use the following code as an example, it draws the texture twice. Texture2D texture; ...
Ben's user avatar
  • 1,309
0 votes
1 answer
1k views

Unity UpdateExternalTexture from MovieTexture windows crash

I'm trying to play a MovieTexture object with a SpriteRenderer object. My code is working fine on OSX. It crashes my windows 7 exported game, and play mode in Unity editor in windows 7. I am sure ...
Tibor Udvari's user avatar
  • 2,982
0 votes
1 answer
517 views

Unity3D Texture2D.Resize leads to Error: afterDecrement >= 0

I have a Texture2D that can be created and resized, and also destroyed quickly depending on user key input. If I quickly hit keys to destroy/create the texture I sometimes get errors, obviously ...
BadmintonCat's user avatar
  • 9,526
0 votes
1 answer
485 views

Scrolling a Texture2D that is in a RawImage?

Is this possible with Unity3D? ... I have a Texture2D in a RawImage that is used to display on a UI Canvas and pixels are drawn into it with SetPixel() and then I want to scroll the Texture2D pixel ...
BadmintonCat's user avatar
  • 9,526
0 votes
2 answers
1k views

Copying a single layer of a 2D Texture Array from GPU to CPU

I'm using a 2D texture array to store some data. As I often want to bind single layers of this 2D texture array, I create individual GL_TEXTURE_2D texture views for each layer: for(int l(0); l < ...
Harry's user avatar
  • 1,422
0 votes
2 answers
133 views

Rendering a textured quad not working

So, I'm making a 2D game using lwjgl, and rendering a textured quad won't work. I have 3 textures, names are : DirtTexture.png, GrassTexture.png, WaterTexture.png All are located inside of the "res"...
Happy Crayfish's user avatar
0 votes
2 answers
1k views

glEnable(GL_TEXTURE_2D); Does not feel like working.... :(

So, I'm trying to apply a texture to my quad. So i wrote this line of code : (line 35 in Artist.java) glEnable(GL_TEXTURE_2D); Which gave me this error : GL_TEXTURE_2D cannot be resolved to a ...
Happy Crayfish's user avatar
0 votes
1 answer
153 views

OpenGL doesn't draw my texture

My problem is that OpenGL 3.3 doesn't draw my texture. I checked if it a problem of my shader (It could not be loaded well) but the shader is OK. Then, I checked if it is a problem with UV coordinates,...
Seyro97's user avatar
  • 93
0 votes
1 answer
596 views

XNA / Monogame Texture2D to to string

I want to store a small png image in a XML file and Load it back to Texture2D. This is what I'm doing Code for saving I'm writing the data of the Texture2D with the BinaryWriter to a MemoryStream, ...
Yunus K's user avatar
  • 15
3 votes
2 answers
1k views

Is it possible to create a Texture2D_Array off several Texture2D objs in OpenGL?

About my intend: I have an image stack and for several reasons I need them all to be separate 2D-textures. Then for some composed display I need like 5-10 of them to be fused together in one display (...
Robetto's user avatar
  • 749
0 votes
0 answers
136 views

How to pass a Array of GL_TEXTURE_2D to the shader?

I know how to pass a single Texture_2D to my shader in lwjgl using: GL11.glBindTexture(GL11.GL_TEXTURE_2D, shadowMapper.depthMap); but how can I pass an array?
Tschwen's user avatar
  • 33
1 vote
2 answers
107 views

Cannot show texture in OpenGL 4.3 using VertexArrayObject

I'm knocking my head on this code since two days ago. It seems that there's no error of any sort creating buffers or textures, but the texture doesn't show. Here is my code for the texture load: ...
Sputanofono's user avatar
0 votes
1 answer
2k views

Optimization for changing pixels of sprite in Unity3D

Problem : After a month, I'm coming back to the prototype for painting on sprite for my mini game. As you see in this thread I've figured out the solution for painting on sprite and because of big ...
ATHellboy's user avatar
  • 704
1 vote
1 answer
1k views

What is texture coordinate P in texture sampler2d lookup GLSL

I've been looking through the OpenGLSL ES 3.0 Spec, but I can't find anything on how the built in function, texture(sampler, p) defines P. I know it is a vec2. Is it a normalized floating point ...
HPP's user avatar
  • 1,104
2 votes
0 answers
343 views

imageStore does not write when using two SSBOs in compute shader

I noticed an error in one of my compute shaders when trying to run it on my ATI HD 5770. I found out that the problems start when I access more then one SSB in the shader, despite ...
Nobody moving away from SE's user avatar
0 votes
1 answer
627 views

Load array of textures into individual Image components into a grid layout in Unity 4.6 (using uGUI)

I'm having a lot of trouble trying to develop a loader that grabs a group of textures located in an array and populates them into a grid layout. Could anyone share some code insight or a snippet that ...
greyBow's user avatar
  • 1,338
0 votes
2 answers
2k views

Loading an image as Texture2D

In my program, I want to save some screenshots and load them later on to compute somethings. I created a methode to compute the image names: static public string generatePhotoName (string cameraName, ...
liquid.pizza's user avatar
0 votes
1 answer
420 views

Writing a HLSL shader for rescaling floating point textures

When using HalfSingle/Single format for my Texture2D, XNA complains that sampling must be set to PointClamp, and this makes my texture look jagged. I am actually using this to pass depth data to the ...
Lou's user avatar
  • 4,344
0 votes
2 answers
679 views

Mac - Linear interpolation not working

I searched a lot and just can't seem to find anything on this topic. I got a Macbook with OpenGL 4.1. I create a Texture with: glGenTextures(1, &heightMapTexture); glActiveTexture(GL_TEXTURE0); ...
eclipse's user avatar
  • 2,901
3 votes
1 answer
2k views

Loading a texture by passing RGB floating point pixel data to glTexImage2D

I have a 2D floating point array with values mapped within the range 0.0f to 1.0f. I load it into OpenGL using a single channel i.e glTexImage2D(GL_TEXTURE_2D, 0, GL_RED, width, height, 0, GL_RED, ...
ccoder83's user avatar
  • 514
0 votes
1 answer
98 views

Second window in C++ OpenGL deactivates SOIL texture in first window

So I've been playing around with SOIL for openGL class, and I am having a weird problem with my project. I am to display two windows containing three viewports each, in which I draw a textured cube or ...
Gnemlock's user avatar
  • 325
2 votes
0 answers
875 views

Trouble using glTexSubImage2D with a pixel buffer object

I am trying to upload a subset of my image to the texture. So, I do as follows: glBindTexture(GL_TEXTURE_2D, textureId); glBindBuffer(GL_PIXEL_UNPACK_BUFFER, buffer); glPixelStorei(...
Luca's user avatar
  • 10.8k
1 vote
1 answer
472 views

Mapping a texture with OpenGL using SOIL

Trying to complete a basic texture map to surface using OpenGL and SOIL but I am not generating anything. GLuint textureID[5]; glutInitWindowPosition(0, 50); windowID[0] = glutCreateWindow("...
Gnemlock's user avatar
  • 325
0 votes
1 answer
2k views

Unable to create a DX11 render target view

I'm trying to get started with DirectX 11 game programming, but for some reason I'm simply unable to create a render target view with ID3D11Device::CreateRenderTargetView(). (BTW, I use VS for ...
PeanutsGrowUnderground's user avatar
1 vote
0 answers
638 views

Direct3D shared texture created in C++ only displays with one line of pixels in SharpDX (video explanation)

When I try to use SharpDX to dump (or display) a shared DirectX10 Texture2D created in C++, the first line of pixels within the texture appears but the rest of the texture is black. I expect the ...
Greig Stewart's user avatar
0 votes
1 answer
2k views

Combine many 2D textures into one and write text on it in Unity (C#)

I have not found solution for my problem. I want to combine few textures (one under another, they won't overlap) and then write a text on one of them. So basically I would like to set some render ...
Peter's user avatar
  • 912
0 votes
1 answer
941 views

Android OpenGL ES 2.0 shader texture2d RGB value range

I use OpenGL ES 2.0 on Android and I wrote a sample shader that uses texture2d to get an image RGB value. vec4 v1 = texture2D(sTexture,textCoord); float r = v1.r; so , is the value of r in the range ...
birds's user avatar
  • 187
1 vote
0 answers
361 views

Texture renders black to large FBO (qt QGLFramebufferObject)

Im rendering to texture using qt QGLFramebufferObject, when i am using FBO about 2000x2000 widthxheight its displays correctly, but when the size exceeds about 2750x2750 the texture displays black. It ...
Storkur's user avatar
  • 49
1 vote
2 answers
7k views

Painting sprite in unity

Problem : I want to make prototype for cleaning windows (I mean cleaning dirty windows) in unity. I was searching about this subject and finding that I can change pixel by Texture2D.SetPixel(). I ...
ATHellboy's user avatar
  • 704
5 votes
2 answers
11k views

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... ...
Mansa's user avatar
  • 2,307
-1 votes
1 answer
215 views

Monogame, Lag issues when map size is increased

Im working on a small project in Monogame. I have a small annoyance though. Currently im loading textures etc on start of the game, Only once. Im then drawing a map from a CSV file, So currently i'm ...
Taylor's user avatar
  • 1
1 vote
1 answer
3k views

Loading Texture2D data in DirectX 11 Compute Shader

I am trying to read some data from a texture2d in DirectX11 compute shader, however, the 'Load' function of a texture2D object keeps returning 0 even though the texture object is filled with the same ...
NULLPTR's user avatar
  • 215
1 vote
1 answer
3k views

Opening bmp image to texture in OpenGL

I'm having problems opening a bmp image to a texture using OpenGl Here is the loadTexture func: GLuint loadTexture() { FILE *f; int imageSize,rd; f = fopen(filename, "rb"); if(f == 0){ printf("...
Javi's user avatar
  • 909
0 votes
2 answers
624 views

OpenGL PBO and texture objects: Do I need to allocate memory for both

I am using a pixel buffer object and texture as follows: // Initialize PBO Gluint _buffer; Glenum target = GL_PIXEL_UNPACK_BUFFER glGenBuffers(1, &_buffer); if (_buffer) { glBindBuffer(target,...
Luca's user avatar
  • 10.8k
0 votes
1 answer
334 views

Fill the area with texture cocos2d-x

I've been trying to make "Obstacle" class which builds box2d body by array of points and draw the area which my body covers. As for body, it works totally ok, I receive array of points, build ...
Eugene Alexeev's user avatar
1 vote
1 answer
6k views

Why no access to texture lod in fragment shader

I'm trying to come to terms with the level of detail of a mipmapped texture in an OpenGL ES 2.0 fragment shader. According to this answer it is not possible to use the bias parameter to texture2D to ...
MvG's user avatar
  • 59k
1 vote
2 answers
2k views

Can't get texture.Sample to work, although I can get texture.Load to work fine in Direct 3d 11 shader

In my HLSL for Direct3d 11 app, I'm having a problem where the texture.Sample intrinsic always return 0. I know my data and parameters are correct because if I use texture.Load instead of Sample the ...
antlersoft's user avatar
  • 14.7k
1 vote
1 answer
4k views

OpenGL/SharpGL: Rendering 2D image is stretched horizontally

I'm playing around with OpenGL in C# (using SharpGL) and I come from a DirectX background... I figured OpenGL would be pretty similar, and it kinda is, except I'm having an issue with my projection ...
SJoshi's user avatar
  • 1,906
2 votes
1 answer
80 views

Open-GL Texture-coordinates changing by changing triangle size

I have a problem with a texture-mapping with Open-GL. (1) is the texture. I want to use a triangle out of this (2) just for description the texture splitted in triangles (3) mapped texture to ...
Thomas's user avatar
  • 2,405
0 votes
1 answer
49 views

How can I shrink my large texture so that it stays centered?

When I shrink my large texture down, it doesn't shrink the image. It just cuts off the image starting from the bottom right and going up diagonally. This is how I am drawing the sprite: spriteBatch....
ernest's user avatar
  • 1,683
0 votes
1 answer
72 views

Loading Texture2D Inconsistently Fails

Sometimes (not always, most times it works flawlessly), I catch the exception I provided when it fails to load a Texture2D. public static class Extras { public static class Load { ...
Dean Reynolds's user avatar
0 votes
2 answers
1k views

Segmentation fault loading texture with Devil into OpenGL

I am attempting to load a texture into OpenGL using Devil, and i am having a segmentation fault upon the calling of this constructor Sprite::Sprite(const char *path){ ILuint tex = 0; ...
DrPresident's user avatar
-2 votes
1 answer
133 views

Textures not working

So ok. That OpenGL state machine is kiddin' me! I'm serious! Just few days ago all worked with immediate mode and even VBO mode, but not today! Today im seein a white quad, cause i rewrote 80% of my ...
RussianVodka's user avatar

1
5 6
7
8 9
14