Tagged Questions
3
votes
0answers
82 views
OpenGL: Filtering/antialising textures in a 2D game
I'm working on a 2D game using OpenGL 1.5 that uses rather large textures. I'm seeing aliasing effects and am wondering how to tackle those.
I'm finding lots of material about antialiasing in 3D ...
8
votes
1answer
309 views
How to reduce image size without pixelation?
I see lots of games with smooth edges characters and high res images, however when I try to reduce images to say 64x64 for my character I just get a pixelated mess. even if I start with a 64x64 canvas ...
0
votes
1answer
90 views
How to seamlessly texture a cube in OpenGL
I have been following this site as an intro to OpenGL.
After going through the model obj loading tutorial, I wanted to create my own .obj (a cube) as well as my own texture. Following this blender ...
0
votes
0answers
21 views
Size of an image imported with FreeImage
I'm having abit of a brainfart and I can't quite grasp what I'm doing wrong.
It's quite simple, I am importing an image with FreeImage (http://freeimage.sourceforge.net/) which has a method ...
-1
votes
0answers
44 views
Texture / shader template program [closed]
I would like to use OpenGL to downsize images, using shaders. I would be very grateful, if somebody can give me a sample program in C++, which loads bitmap texture, draws it to the entire screen and ...
-2
votes
0answers
36 views
rendering or calling textures on the wall of the cube [closed]
what am i doing wrong im trying to call or render textures for my cube but when i put this code in the main program and run it all im getting is a black screen the cube vanishes am i calling ...
0
votes
0answers
51 views
textures and bouncing balls inside a cube [closed]
i have a cube with texture but when i add 3 balls so that they bounce on the walls of the cubes everything seemed to be wrong,the balls are not bouncing in the right directions, i want them to bounce ...
0
votes
0answers
35 views
trying to add texture to my code [closed]
I have been working on making a cube and I have some balls inside it though I am having problems on how I can put or add texture to my code. I am trying to learn but it seems whatever material I'm ...
3
votes
1answer
94 views
Multiple Textures in Shader?
I have this (pseudo) code:
unsigned int TextureLoc = glGetUniformLocation(programID, "objectTexture");
for(int i = 0; i < object->texturesCount; i++)
{
glActivateTexture(GL_TEXTURE0);
...
0
votes
1answer
150 views
How expensive is OpenGL Texture Binding
I'm currently working on a renderer for Tiled's .tmx maps. Among one of the features there is that layers and tilesets are independent, so that a layer can use any tile set on any tile. It's not so ...
0
votes
1answer
124 views
OpenGL accepted image formats
I am just starting out with OpenGL, so I need a little help understanding how textures are loaded. When I look at the OpenGL manual, it gives a list of accepted image formats, e.g.
...
0
votes
1answer
176 views
Stars coming out of screen [closed]
I am pretty new to Graphics Programming. I am currently using OpenGL.
I have got some hands-on in last few days. I have knowledge of Texture Mapping, Cubemap, Multitexturing. But somehow I am not able ...
0
votes
1answer
123 views
Using compressed(ETC1) textures in LibGDX
I use standard android tool for compressing PNG texture and archiving it with gzip:
/android-sdks/tools/etc1tool texture.png --encodeNoHeader
gzip texture.pkm
Then I try to load it:
FileHandle ...
0
votes
0answers
100 views
Using OpenGL3.3 and GLSL, texturing is not working [closed]
I am having troubles getting texturing working in my OpenTK/OpenGL 3.3 code. I am sure it is something simple that I am missing, but I just can't seem to get a texture on the square I am rendering. ...
5
votes
1answer
282 views
Is a 10 meg 2048x2048 bitmap too big a size texture to use in an OpenGL game?
This is a speed question, I have a texture, which is 2048 per 2048, the texture is designed to run in big resolutions (1920x1080 for example).
The problem is, that the texture have a size of 10MB in ...
0
votes
1answer
102 views
SDL_Image and typical SDL BMP loading fails completely
been messing with OpenGL and SDL for a pair of weeks.
The thing is quite weird. I have been loading a texture from a BMP and using a really easy shader to make it work, and so far it has worked very ...
0
votes
1answer
81 views
Devices or Smartphones That Can Run and Displayed Images Properly While Power of 2 Code is Disabled
Before making game apps, I want to have any certain smartphone device brands that runs on OpenGL. I have to make a code for images that doesn't need to required power of 2 images so that I can resize ...
0
votes
1answer
94 views
How to scale a texture in OpenGL/LWJGL?
How would I take a texture and render it to a specific size? The texture I'm rendering has a 1:1 ratio so I want to be able to render the whole image like if the window is wide then put black outlines ...
0
votes
1answer
118 views
Initializing a blank texture in OpenGL without artifacts
I'm generating a texture atlas in OpenGL, where I want to create a blank texture and copy my sprites to it.
The texture is generated like this:
glGenTextures(1, &texture);
...
2
votes
1answer
146 views
Any drawback to using rectangular textures over square textures in OpenGL?
I'm thinking about texture atlas generation where I'd have to choose the dimensions of my atlas, constrained both by my sprites and by the maximum texture size of the current platform.
Given that, is ...
1
vote
0answers
86 views
glFramebufferTexture2D gives corruption with cube map textures
I am using glFramebufferTexture2D with cube map textures but it gives corruption in texture. draw_cube() function works perfectly when i draw that on default framebuffer.
GLenum ...
12
votes
4answers
1k views
How to avoid texture bleeding in a texture atlas?
In my game there is a Minecraft-like terrain made out of cubes. I generate a vertex buffer from the voxel data and use a texture atlas for looks of different blocks:
The problem is that the texture ...
0
votes
0answers
115 views
2D Textures are shown through objects in front of it(OpenGL)
I am learning to use pyglet and learning about applying 2D textures to planes in pyglet. When I apply the 2D texture to the plane it works fine. When I make multiple objects with the same texture , ...
1
vote
2answers
250 views
VBO with texture index buffer different than vertex index buffer
I am trying to write my own OBJ importer and renderer in OpenGL (yes, I know, reinventing the wheel) and I found a problem that I don't knwo how to handle.
In an OBJ file faces are defined by a list ...
0
votes
0answers
150 views
Regarding Multisampling of textures [closed]
i am rendering white cube with green background in non default FBO and attaching the created multisampled texture to this FBO. When i render a cube in default FBO using above texture, it gives ...
1
vote
1answer
91 views
Multisampled Texture
i have some doubts with multisampled textures.
In fragment shader, how to pass multiple samples?
We use glTexImage2DMultisample instead of glTeximage2D. so, how to upload texture data?
I want to ...
5
votes
1answer
112 views
Blend multiple regions from same texture atlas
I'm representing terrain in my game as a grid with at each node a composition, for example 100% rock, or 50% grass, 50% soil. I'd like to use this composition vector to blend textures together. I'm ...
0
votes
0answers
48 views
System hangs at glReadPixel call with GL_TEXTURE_2D_ARRAY for texturing
I am calling glReadPixel after glDrawArray call. I am rendering a geometry with 3D texture on it as a target GL_TEXTURE_2D_ARRAY. My systems hangs at glreadpixel call. When i use target as ...
2
votes
1answer
131 views
Tutorial on OpenGL texture formats
Looking at the documentation glGetTexImage(), one can see that there are plenty of available texture formats.
GL_TEXTURE_1D, GL_TEXTURE_2D, GL_TEXTURE_3D, GL_TEXTURE_1D_ARRAY, GL_TEXTURE_2D_ARRAY, ...
0
votes
0answers
274 views
3D texture coordinates for a cube
I want to use glTexImage3D with cube. what will be the texture coordinates for it? i am using GL_TEXTURE_3D as target. I tried with u v coordinates same as 2d texture coordinates with z component ...
0
votes
1answer
177 views
Image loaded from TGA texture isn't displayed correctly
I have a TGA texture containing this image:
The texture is 256x256.
So I'm trying to load it and map it to a cube:
#import <OpenGL/OpenGL.h>
#import <GLUT/GLUT.h>
#import ...
0
votes
0answers
23 views
Unexpected behaviour with glFramebufferTexture1D
I am using render to texture concept with glFramebufferTexture1D. I am drawing a cube on non-default FBO with all the vertices as -1,1 (maximum) in X Y Z direction. Now i am setting viewport to X ...
1
vote
1answer
110 views
fragment shader with SNORM textures
I want to apply SNORM texture by using GL_TEXTURE_3D as a target, what will be the fragment shader for the same?
Also, what should be the data type of texture data?
2
votes
2answers
401 views
OpenGL : sluggish performance in extracting texture from GPU
I'm currently working on an algorithm which creates a texture within a render buffer. The operations are pretty complex, but for the GPU this is a simple task, done very quickly.
The problem is that, ...
0
votes
1answer
94 views
OpenGL : Keeping alpha in a render buffer
In my current task, i need to render a texture into a render buffer, in order to work on it (apply special filters) there. The result is then considered a "new texture", which is later displayed.
...
3
votes
0answers
192 views
Suitability of ground fog using layered alpha quads?
A layered approach would use a series of massive alpha-textured quads arranged parallel to the ground, intersecting all intervening terrain geometry, to provide the illusion of ground fog quite ...
1
vote
1answer
197 views
how to use a mask texture?
A texture pack for a sponza model contains mask textures (black and white). I guess that I should read only a red channel from that texture, right ? I use deferred rendering and for shading ...
1
vote
0answers
48 views
Rendering text with stb_font results in glitches
I'm trying to render text with OpenGL and an "inline"-font taken from the stb_fonts
The relevant code for initializing the font & rendering:
LabelFactory::LabelFactory() {
static unsigned ...
1
vote
1answer
174 views
Problem when texturing triangles using glVertexPointer()
I'm having a problem for displaying a single quad, here is how i do :
//note: this code is only for 2 triangles, while on picture there is 4 triangles
float tex_coord[] =
{
0.0, 0.0, //3
0.0, ...
17
votes
6answers
2k views
Creating a retro-style palette swapping effect in OpenGL
I'm working on a Megaman-like game where I need to change the color of certain pixels at runtime. For reference: in Megaman when you change your selected weapon then main character's palette changes ...
5
votes
1answer
138 views
2-components color model
RGB is the natural color model for OpenGL. But a lot of other color models exist.
For example, CMY(K) for printers, YUV for JPEG, the little cousins YCbCr and YCoCg, HSL & HSV from the 70's, and ...
0
votes
2answers
217 views
LWJGL - OpenGL - Texture shading
I want to use LWJGL to create a shader that all it does is change the color of the given texture. For example I tell it to draw the letter A using a sprite sheet then I can tell the shader to draw the ...
1
vote
3answers
168 views
SDL_image & OpenGL Problem
i've been following tutorials online to load textures using SDL and display them on a opengl quad. but ive been getting weird results that no one else on the internet seems to be getting...
so when i ...
0
votes
1answer
164 views
TGA loader: reverse y-axis
I've written a TGA image loader in Java which is working perfectly for files created with GIMP as long as they are saved with the option origin set to Top Left (actually TGA files are meant to be ...
0
votes
1answer
131 views
Objects won't render when Texture Compression + Mipmapping is Enabled
[EDIT: FIXED - Calling setting texture max level fixed that]
I'm optimizing my game and I've just implemented compressed (DXTn) texture loading in OpenGL. I've worked my way removing bugs but I can't ...
2
votes
1answer
146 views
Fourth texture = segmentation fault
I keep on getting segmentation fault each time I load fourth texture - what type of texture, I mean filename, does not matter. I checked value of GL_TEXTURES_STACK_SIZE which turned out to be 10 so ...
0
votes
2answers
1k views
Map and fill texture using PBO (OpenGL 3.3)
I'm learning OpenGL 3.3 trying to do the following (as it is done in D3D)...
Create Texture of Width, Height, Pixel Format
Map texture memory
Loop write pixels
Unmap texture memory
Set Texture
...
0
votes
1answer
182 views
My Maya texture does not render at all in Open GL! [closed]
I uploaded my layered Maya (Maya 2012) Textures via objLoader into my opengl project. I also uploaded 3D textured model. I am able to render a model but not even one texture is showing.
Before pasting ...
5
votes
1answer
277 views
How to flip a BC6/BC7 texture?
I have some code to load DDS image files into OpenGL textures, and I'd like to extend it to support the BC6 and BC7 compressed formats introduced in D3D11. Since DirectX and OpenGL disagree about ...
2
votes
2answers
289 views
Can't get simple OpenGL texture working using SDL2 and FreeImage3
I created a simple OpenGL program that display a quad with texture, but it doesn't seem to be working as it only displays a white quad. What could possibly be wrong? I checked everything I could think ...
