Categories
Game Creation Mastering Development

Trouble generating a depth map (black screen)

I am having trouble generating a depth map for my scene. I tried to figure out this issue a 2 weeks ago and got nowhere after days of trying to fix it, so I took a break and tried to tackle it again today. I’m still stuck and with no ideas. Here’s the main code: […]

Categories
Game Creation Mastering Development

(While using a cube map) box-like textures appearing around my scene whenever I move the camera

I’ve been learning about cube map and I implemented one into my program. It seemed to work well until I started moving the camera around the scene and zooming out. As you can see in the attached gif, there seems to be a problem with the cube map since this weird behavior is occurring: https://gyazo.com/70ad4ce027d1e032bc19258e28def66f […]

Categories
Game Creation Mastering Development

Skybox textures is black

My skybox is displayed, but does not display the textures that I load from the image. Instead, it shows the transparent color if i set glTexImage2D how GL_RGBA, or black color if i set glTexImage2D how GL_RGB. I am using a render with MultisampledFbo support. My texture loading code looks like this: private int loadSkyboxTextures(){ […]

Categories
Development

OpenGL Texture is not rendered (C)

I want to render a simple picture between a rectangle (two triangles) but when I start the program, there is just a black rectangle instead of the picture. To render the picture, I´m using shaders, which I acces with uniforms. I can´t find a mistake, why It´s not rendering. Could you please help me? main.c […]

Categories
Development

using procedural generation to creat a disk but the texture does not work properly

Tried posting this as two problems in one question earlier. Decided to tackle one at a time to reduce the wall of code proeceduralgeneration.cpp void proeceduralgeneration::renderdisk(int sides) { float interval = ( 2 * PI )/sides; float angle = 0.0f; myTexture = SOIL_load_OGL_texture ( “gfx/ground.png”,//texture link SOIL_LOAD_AUTO, SOIL_CREATE_NEW_ID, SOIL_FLAG_MIPMAPS | SOIL_FLAG_NTSC_SAFE_RGB | SOIL_FLAG_COMPRESS_TO_DXT ); glBegin(GL_TRIANGLES); […]

Categories
Development

bmp texture not loading correctly using Open GL

Hello everyone I’m trying to load a texture (normal map) using OpenGL. GLuint loadTexture(const char* fileName) { GLuint textureID; glGenTextures(1, &textureID); // load file – using core SDL library SDL_Surface* tmpSurface; tmpSurface = SDL_LoadBMP(fileName); if (tmpSurface == nullptr) { std::cout << “Error loading bitmap” << std::endl; } // bind texture and set parameters glBindTexture(GL_TEXTURE_2D, textureID); […]

Categories
Development

Fragment shader ignores texture coordinates

I am learning OpenGL through the tutorials at learnopengl.com. I’ve already drawn my hand-defined 3×3 texture onto a square using 2 triangles without a shader. Using shaders, however, I don’t understand this weird behavior: The fragment shader seems to ignore texture coordinates but strangely paints my two triangles with the color of the first pixel. […]

Categories
Android Development

OpenGL ES for Android requires 2.0 commands for 3.0 context?

I’m rendering video using glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, decodedFrame.width[j], decodedFrame.height[j], GL_LUMINANCE, GL_UNSIGNED_BYTE, null); I was using GL_RED in place of GL_LUMINANCE because I thougth that, since im using OpenGL #version 320 es in my shader, I need to use OpenGL 3.x commands like GL_RED. But GL_RED wont work, only GL_LUMINANCE does. Here’s how I’m creating […]

Categories
Android Development

Rendering YUV video on Android, textures aren’t being uploaded to texture units

I ported working code from C++ to Java. In C++ I used the same shaders as here and the same code, and I was able to use 3 texture units of the GPU to load the Y, U and V components and then use texture() to join these textures into an RGBA buffer to be […]

Categories
Development

OpenGL + SDL2 + Compute Shader = black screen

I’m translating a C raytracer into glsl so I can use it in a compute shader. For now I’m just trying to render some fuzzy patterns on screen. There are no compilation errors, however nothing renders. I was following these two tutorials (the latter is fairly incomplete and leaves some portions out, I might have […]