OpenGL is a graphics standard and API which targets the desktop and workstation markets. It is designed to be easy to accelerate with dedicated computer hardware, and hence most implementations give greatly improved performance over traditional software rendering. Currently, OpenGL is used for ...
3
votes
2answers
230 views
Where and how to smooth a voxel-based terrain surface?
I want to smooth the blocky terrain in a Minecraft-like world. The smoothing affects visual appearance and physics but not the logic of placing and picking blocks. I have my mathematical formula to ...
0
votes
0answers
67 views
Rendering OpenGL to a specific scale [closed]
So I'm making a 2D game that I want to be able to change the window size. I plan on having the game being 4:3 and border any unused edges. Now the problem comes in that I need to take the current ...
0
votes
1answer
61 views
Problems projecting a point to screen [closed]
In my game I'm trying to implement an equivalent of gluProject, my problem is that the code only seems to work if the camera has no rotation. Even turning left and right affects the vertical position ...
0
votes
1answer
121 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 ...
3
votes
1answer
393 views
creating a UI menu in c++
Im currently working on a 2D Game where the users can interact with specific nodes and are able to edit certain bits of information and I also plan for the users to be able to click buttons to set ...
2
votes
1answer
204 views
HDR / Tone Mapping - choosing parameters
I implement HDR in my graphics engine (deferred rendering) based on this document: link I save a luminance in a texture (RGBA16F) this way:
const float delta = 1e-6;
vec3 color = texture(texture0, ...
0
votes
0answers
106 views
Program created with glCreateProgram is not identified as a valid OpenGL program outside [closed]
I've starting programming in OpenGL and I decided to create my own class to manage shader objects.
In the class constructor I create a new program calling glCreateProgram, and I'm able to print its ...
1
vote
1answer
65 views
Finding Surface of Inner Voulme mesh
I am working on the generation of Hexhedral mesh generation using octree based discretization. what I want I have volume mesh (Hexhedrals), Now using isomorphism I need project the outter most surface ...
0
votes
0answers
43 views
iOS billboard rendering performance
What is the fastest way to render semi-transparent billboards (for a particle system) on iOS? I'm currently using GLES1, but if required for performance I can switch to GLES2.
Does sorting the quads ...
4
votes
2answers
290 views
C++/OpenGL Game - How to Make it Compatible with Screen Recorders?
I'm developing a 3D tower defense-like game in C++/OpenGL on Windows.
The problem I'm having isn't about the game itself (the game runs fine), but it's about using screen recording software to record ...
1
vote
0answers
92 views
Sketchy results from ray-plane intersection code
I've set up a demo with simple first-person controls using C++ and OpenGL, and it seems to work reasonably well. My goal is this: when the player looks at a plane and clicks the left mouse button, ...
2
votes
2answers
284 views
Does my 2D OpenGL renderer need optimized?
I've started a game engine for learning purposes. I have successfully gotten an opengl renderer working and I can draw textures of varying sizes to the screen. The way I have done this is by creating ...
2
votes
1answer
210 views
glsl 150 struct in uniform buffer object
Can I do this in opengl 3.2 / glsl 150?
glsl shader:
struct LightSource {
vec4 ambient;
vec4 diffuse;
vec4 specular;
vec4 position;
vec4 direction;
};
...
layout(std140) uniform ...
0
votes
0answers
96 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
281 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
2answers
327 views
Drawing Sprites in Android OpenGL efficiently?
I want to basically give myself some sprite drawing functions (making use of openGL) such as;
draw(Texture,x,y)
I want to do this using OpenGL-ES 2.0 on Android. Since the textures can be varying ...
1
vote
2answers
95 views
How to get a texture from current point of view in OpenGL 2.0 ES?
Probably the title is confusing, but I didn't know how to ask better, sorry about that. What I would like to do is get a bitmap texture that represents exactly what's rendered at one point in time and ...
0
votes
1answer
100 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
3answers
124 views
How to cache a large object
I have an object made up of many vertices that changes very rare (for the most part of time, it looks the same) and I'm trying to figure out a way to avoid rendering all its vertices every frame. ...
2
votes
1answer
140 views
How to transform a shadow map to camera view?
I'm making a rendering engine as a hobby to learn more about 3D. I have a deferred renderer with the G-buffer (color, normal and depth). I also have a lighting controller that uses only spotlights at ...
0
votes
1answer
55 views
Slick2D ingoring aplha channel?
When I use the draw method inside a image, it completely ingores the alpha channel and fills it in with white. Is there a way I can draw it where the alpha is see through like it's suppost to be? I ...
0
votes
2answers
154 views
OpenGL - can't use glew 3.0 [closed]
I've been trying to follow a tutorial of glew, but i can't run this glGenVertexArrays, it always leads to a memmory access violation!...
I tried glExperimental = GL_TRUE too, also updated my video ...
2
votes
1answer
248 views
How to make a simple HUD with no library
I am writing a simple game in c++ using opengl in a windows system.
I have the scene and I need some informative text to appeared to the left top/bottom of the screen
I am printing these messages ...
-5
votes
3answers
204 views
in the shadow of a sphere [duplicate]
(Related, but somewhat different, to my previous question)
How can I determine in a fragment shader if a fragment is in the shadow of a sphere?
That is, if it is occluded by the sphere and is past ...
1
vote
1answer
154 views
Creating a frustum for culling in world-space glm matrices
I need to do frustum culling where the bounding boxes are in world-space to determine which entities get to be updated/drawn. I was trying to use the classic projection/view matrix plane extraction ...
0
votes
0answers
55 views
Which opengl toolkit should i use [closed]
I really want to learn Opengl and i`m confused about all these toolkits glut, sdl
The question is which should i learn, and i will be happy if you post some tutorials about them. Also from which one ...
0
votes
3answers
206 views
Why doesn't glBindVertexArray work in this case?
From my understanding of what glBindVertexArray does and how it works, the following code should work fine:
First init:
glGenVertexArraysOES(1, &_vertexArray);
...
5
votes
1answer
479 views
OpenGL: Resizing Display and glOrtho/glViewport
I have researched this question from several sources and have yet to find a firm answer saying that "yes that is correct thinking" or "no, here is how it's done."
I am trying to ensure resolution ...
1
vote
0answers
111 views
What is the recommended way to output values to FBO targets? (OpenGL 3.3 + GLSL 330)
I'll begin by apologizing for any dumb assumptions you might find in the code below since I'm still pretty much green when it comes to OpenGL programming.
I'm currently trying to implement deferred ...
2
votes
1answer
152 views
Not repeating background in platformer [closed]
I need to make not repeating background for platformer. I can't find any description of implementation and I developed algorithm but I'm not sure that it's right.
I can't load one big texture per ...
6
votes
1answer
173 views
Getting started to OpenGL - little question
Im starting to learn opengl, and after 2 days, searching and trying hard, i finally installed all the libraries i need (lol).
So, I'm following this tutorial, and it says to use glfwOpenWindowHint ...
1
vote
2answers
196 views
Render rotated rectangle inside other rectangle bounds using Libgdx
I have this code to generate a red rectangle inside a grey rectangle:
new Rectangle(grey_rectangle_position_x, Game.SCREEN_HEIGHT/2-Rectangle.height/2,0);
This code makes the following:
Now, I ...
0
votes
1answer
79 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 ...
1
vote
1answer
284 views
Why does glGetString returns a NULL string
I am trying my hands at GLFW library. I have written a basic program to get OpenGL renderer and vendor string. Here is the code
#include <GL/glew.h>
#include <GL/glfw.h>
#include ...
0
votes
1answer
120 views
How do I apply 2 rotations about different points to a single primitive using OpenGL
I'm working on a 2D top-down shooter game that has a rotation feature like Realm Of The Mad God such that if you press e the camera rotates around the character in a clockwise direction and q rotates ...
2
votes
0answers
140 views
deferred rendering and gaussian blur - artifacts
I compute Gaussian blur in two passes (horizontally and vertically). Shaders look like this:
Horizontal blur - fragment shader:
#version 420
layout (location = 0) out vec4 outColor;
in vec2 ...
1
vote
2answers
104 views
LWJGL MouseY Coordinates are flipped
So I'm very new to using OpenGL and LWJGL, although I am proficient in Java itself.
One of the first things I read in the documentation of the Display class was that it maps the origin to the bottom ...
0
votes
4answers
220 views
Opengl lighting not working
I have rendered a spinning model in LWJGL. I have calculated normals and enabled lighting. Now I make a light:
float lightpos[] = {0, 0, 0, 0};
FloatBuffer lightposb = ...
0
votes
1answer
134 views
Using two FBOs results in the second FBO having nothing drawn to [closed]
I'm writing a deferred renderer, and I use two FBOs: the first one for G-buffer (color, normal, depth) and the second one for lighting (light output), so the first one has three textures bound and the ...
0
votes
0answers
104 views
Detect Sprites, they are in Shape or Not which random draw in Cocos2d
I have searched a lot on web and found some of help ful links as exact my question.
Link 1 Link 2
But still i am not success to achieve this,
i have done some of code lines, as like draw line by ...
2
votes
2answers
294 views
Bezier curve not drawn correctly
I'm trying to draw a bezier curve using 3 points. If I use the quadratic form:
I get this result:
And I believe it's correct.
Now since I need to draw it with a variable number of points, ...
0
votes
2answers
174 views
OpenGL: Transformations
I'm not sure if I correctly understand 3D transformations in OpenGL. Let's assume I'm using the typical matrix stack.
It seems like you move the world X units over, drop in a bag of verts (a mesh) ...
3
votes
2answers
234 views
Jagged transparency when rendering translucent textures (OpenGL 3.2 + GLSL)
Like most others, I'll start off mentioning that I'm still a beginner when it comes to OpenGL and GLSL programming. So bear with me on any dumb mistakes you may spot in the code ahead.
I'm basically ...
1
vote
1answer
265 views
FFMPEG Opengl video rendering
I'm searching any way to render with ffmpeg, an opengl texture that contains the video frame.
Actually, I am not good with ffmpeg... Is there any library/documentation or something?
How can I render ...
-1
votes
1answer
157 views
GLSL code is very slow…why? [closed]
I know this is a very difficult thing to simply modify without the full project code, but I am having a massive performance problem with GLSL code that seems to be very efficient to me. I am stuck at ...
4
votes
4answers
398 views
Why do most game devs prefer OGL for OS X and D3D for Windows? [closed]
Today I decided to check what Diablo 3 developers used to do graphics: OpenGL or Direct3D? My mind was completely blown: For Windows, they've used D3D and for OS X they've used OGL.
I did some ...
-4
votes
1answer
168 views
Is OpenGL 1.1 really slow? [closed]
If anyone ever played minecraft and realized no matter what computer you have it normally doesn't give over 100 FPS? While looking at decompiled code from it I noticed it renders with OpenGL 1.1 ...
0
votes
1answer
84 views
Can I use multiple OpenGL version together
I want to use GLSL but keep my current OpenGL 1.1 setup. The thing is that can I use OpenGL 2.0 shaders on OpenGL 1.1 renders?
0
votes
1answer
92 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 ...
-2
votes
1answer
127 views
SDL_BlitSurface does not works
I have an issue with the SDL_BlitSurface...
When I blit (SDL_BlitSurface) in a transparent (background) surface, it does not blits, actually I tried all the existants functions ...