Texture2D is a class in unity3d used to handle textures. The class allows to edit existing texture assets or to create new textures on the fly.
Questions tagged [texture2d]
661 questions
-1
votes
1 answer
openGL uniform attribute location invalid
For my 2D, opengl/sdl game I'm currently running an opengl log file which prints out the following openGL program properties:
GL_LINK_STATUS = SUCCESS
GL_ATTACHED_SHADERS = 0
GL_ACTIVE_ATTRIBUTES = 2
- 0) type:vec2 name:textCoord location 1
- 1)…

Jason
- 2,198
- 3
- 23
- 59
-1
votes
1 answer
Is there a way to scale an image down to a specific size?
I am currently trying to get some kind of 2D dungeoncrawler (think: roguelike) running. Now I want to work with square tiles (32x32) but I wonder if there's a way to make my textures in a higher resolution, say 64x64, and scale them down onto a…

Vorax
- 1
- 1
-1
votes
1 answer
Texture Mapping in GLSL
I am currently working on a project where I have to texture a cube using the reflection vector between the normal of a fragment and the camera.
I have the sampler2D picture, and I somehow have to implement it to a cube using reflection.
The…

ficabj5
- 111
- 10
-1
votes
1 answer
How to display texture on the screen?
I have a unity scene. I try to display a texture that changes dynamically.
I draw some shape on this texture. How can I do it?
If I use onGUI and Graphics.DrawTexture method, it works too slow on mobile platform.

zakjma
- 2,030
- 12
- 40
- 81
-1
votes
2 answers
How to display 2d image on the screen unity3d
I created a unity application for desktop and mobile platforms. There is a map on top-left corner of the screen. I draw circle on this map each frame. The position of the circle changes at runtime anytime.
To do for this task, I draw circle on…

zakjma
- 2,030
- 12
- 40
- 81
-1
votes
1 answer
Can't render simple transparent sprites in SharpGL
I know how to generate a plane and map a texture. Now, I am trying to display an alpha-blended PNG on my form, like it was a sprite.
I have come up with the following code from Googling and guessing:
// Get the OpenGL object.
var gl =…

CyberFox
- 780
- 6
- 24
-1
votes
1 answer
What's going wrong with my textures?
I'm trying to have a Unity program where I have 5 UI objects and 3 3D objects and take their texture in the script and generate a new texture file with all those and then assign that texture to the objects. I have my 3D objects change texture upon…

Jake Howard
- 21
- 1
- 8
-1
votes
1 answer
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 drawing a map of 3600 tiles, Each tile sizing at…

Taylor
- 1
-1
votes
1 answer
Why texture (GL_TEXTURE_2D) cannot work with (VertexArray) VAO
I am working on a project with openGL part. The scenegraph part is based on core OpenGL1.0 and still use glBegin and glEnd.
Now I am adding new stuff on it and has to use VAO. I am a beginner and use QOpenGLFunctions_3_0 because I cannot find gl3.h…

langbeibei
- 1
- 1
-1
votes
1 answer
Unity3d C# -> generating a perlin noise texture with layers
I am trying to generate a noise texture with the LibNoise library using perlin and some fractal to create 6 layers that i can add together in one image.
I have problems that i can't seem to fix:
(3 problems that show in the debug log.)
1) The image…

Po0ka
- 107
- 3
- 9
-1
votes
1 answer
Adding texture to elements with openGL
I'm trying to build a giraffe with openGL. I already made the body and the walking, but I want to add texture I found. I'm adding my code for you to see.
#define _CRT_SECURE_NO_DEPRECATE
#include
#include
#include…

itzick binder
- 524
- 10
- 31
-1
votes
1 answer
hrc = wglCreateContext(hdc) , wglMakeCurrent(NULL,NULL) and glEnd() throw INVALID_OPERATION
I have downloaded the class Setting Up OpenGL in an MFC Control and customized it for my purpose ( showing an image and making zooms and other translates on it ):
OpenGLControl.h
#pragma once
#include "afxwin.h"
#include "gl\GL.h"
#include…

Sepideh Abadpour
- 2,550
- 10
- 52
- 88
-2
votes
1 answer
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 old code. Thats such a cool thing, yo know.
So. I…

RussianVodka
- 450
- 1
- 6
- 18
-2
votes
1 answer
Why won't my texture render?
For some reason the texture I load will not display/render. I've gotten a texture to render on previous projects with almost identical code, but for some reason it will not render with the below code. I've posted the init() and createGreenFields()…

calcrisk33
- 437
- 1
- 6
- 15
-3
votes
1 answer
OpenGL 2d texture class isn't working but same code works outside class in main loop?
I am learning OpenGL following https://learnopengl.com/ I wanted to take the 2D Texture code and put it into a class. The code works fine in the main file, but that same code, copy and pasted into the texture class, doesn't work at all. Leads to a…

BluntPika
- 3
- 4