Tagged Questions

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 ...

learn more… | top users | synonyms

0
votes
1answer
435 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
370 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 ...
-3
votes
2answers
265 views

Need help with game development. (I know C++ and I need to learn an API) [closed]

I know C++ but I don't know an API looking at Directx. I can't find any good tutorials and really need some help to start 2D game development. I'm doing an game development focused Art course that ...
0
votes
1answer
237 views

From maya to c++ and opengl

I want to load an object created with Maya in c++ with opengl, how could I do this? Thank you.
4
votes
1answer
727 views

OpenGL, fetching the names of all uniform blocks in your program

I want to auto-bind uniform blocks with certain named values to certain binding points when I compile a shader. For example, I have some basic, default fixed binding points that are always used for ...
11
votes
1answer
441 views

How to achieve light that changes color mid-way?

I thought of creating light sources, and some colored windows. Now, the windows are semi-transparent. How could I make it so that when the light (say, pure white) hits the glass and continues through ...
3
votes
1answer
1k views

Cook Torrance model implementation : black specular light

I am trying to implement the Cook-Torrance model, and this is how I calculate the parameter Rs: float Rs(float m,float F,vec3 N, vec3 L,vec3 V, vec3 H) { float result; float NdotV= ...
0
votes
1answer
161 views

In OpenGL Shader, Why adding color change vertex position?

I have the following vertex shader: #version 120 attribute vec4 position; attribute vec4 acolor; varying vec4 theColor; void main(){ gl_Position = position; //theColor = acolor; //[1] ...
1
vote
1answer
610 views

How to rotate a direction

I'm working a spotlight for my deferred renderer and I'm having trouble with matching the mesh to the visual representation of the light. Right now my mesh is a cone, the apex of the cone is at ...
2
votes
1answer
147 views

Fragments never falling into spot light's cone

I am using GLSL version 1.20 with OpenGL 2.1 . I am trying to compute when a fragment falls into the area of a spot light. I have already set all the light values with glLightfv and glLightf, also ...
2
votes
1answer
383 views

mixing forward and deferred rendering

Simplified version of my deferred rendering looks like this: bind fbo1 clear color and depth buffers gbuffer stage (gbuffer contains only these pixels which pass a depth test) unbind fbo1 bind fbo2 ...
3
votes
1answer
350 views

Fill texture with white color

How to paint texture with white color? Example what I mean: SpriteBatch.setColor changes tint only.
0
votes
3answers
358 views

Phong lighting model unrealistic result

I am using OpenGL 2.1 and GLSL 1.20 . I am trying to compute the fragment color applying the Phong lighting model. This is the formula I have (the original formula has a summation, but since the ...
1
vote
1answer
374 views

What book/guide should I follow for GLSL [closed]

I searched a lot on the web without coming to a real solution and if I ask this it's because I really have difficulties getting an answer. I need to learn well GLSL 1.20 with OpenGL 2.1. I have ...
0
votes
1answer
435 views

vec4 for vec3 multiplication while calculating the specular value

I'm following this tutorial to calculate the specular color of a vertex. I use OpenGL 2.1 with GLSL version 120. This is the formula that I apply: spec= (R*eye)^s * Ls * Lm With: ...
-3
votes
1answer
79 views

C++ Loading DLL Error [closed]

So I'm attempting to fix a OpenGL in Java problem by making a DLL in C++ and then call it from Java but I've ran into an issue. So I'm testing a basic DLL in C++ and I got this error: "error: ...
0
votes
5answers
562 views

Does Java support OpenGL by itself?

Note: This is long but I explaining everything that you need to know. Don't read half way through it and say "What's the question?". It's simple but long and I need help as soon as possible. So I ...
1
vote
1answer
2k views

Can I mix OpenGL and swing?

I'm working on a small game library for me and some people I know that just handles the window and nothing special that we weren't gonna use. I know how to use OpenGL and stuff I just don't like ...
0
votes
3answers
999 views

How to draw only visible tiles?

I have a big map with isometric tiles(3d camera), how can i draw only visible tiles ? Whats the best way to do that ? space partitionning (octrees etc...)?
-1
votes
1answer
987 views

How can I switch between DirectX and OpenGL renderer in my engine?

I am currently developing my engine with DirectX, but I want to make it cross-platform in the future, using OpenGL. How can I check which platform my engine is running on? And can I use an if ...
0
votes
1answer
143 views

deferred rendering and a few shading functions

How to use a few shading functions together with deferred rendering (for example some objects are shaded based on a lighting equation, other get a fixed color) ? I draw a full screen quad when ...
16
votes
1answer
2k views

Why does this geometry shader slow down my program so much?

I have an OpenGL program, and I'm rendering a terrain mesh. I displace the vertices in the vertex buffer and don't really color them in the fragment shader yet. I'm adding a geometry shader one part ...
-2
votes
2answers
196 views

Tangent plane for point on surface mesh

I am working on the generation of hexahedral mesh , for surface construction i need to find the tangent plane for each point on the surface.
2
votes
2answers
4k views

Using Assimp to load dae files

I've started looking into using Assimp to load in dae collada files into my game. I believe I've managed to load the file into aiscene. I am using c++, OpenGL and SFML. My problem lies with ...
3
votes
1answer
389 views

How to do perspective projection “parallax” but without changing the scale or offset of objects?

Hello everyone I have this problem that I have tried everything I could think of. The problem: I am making a 2D game with parallax effect but I am using 3d space so am not simulating the parallax but ...
1
vote
1answer
406 views

Indoor 3D game worlds

I'm looking for a little direction. I'm building a game engine as a part of my university project, and I'm having a little trouble about what to look for when it comes to indoor 3D game worlds. Now ...
0
votes
1answer
190 views

OpenGL RTT FrameBuffer question and Rendering to texture while sampling it

What i need to do: Blur the selected texture and pass the texture to another effect for postprocessing. Notice that i want one texture passed all over. How do i want to do this: Bind the FBO ( ...
5
votes
1answer
503 views

What are the rest of the blending functions used for?

In general, I know of five ways to make use of blending functions (these are for OpenGL, but replace glBlendFunc() with SetRenderState(D3DRS_SRCBLEND) and SetRenderState(D3DRS_DESTBLEND) for DirectX): ...
1
vote
1answer
267 views

Using OpenGL GLEW within Unity

Edit:- How do I implement GLEW (or OpenGL extension libraries) within Unity? Original Question:- I've recently been looking into some really nice features of OpenGL 3.2 that I want to take ...
3
votes
1answer
524 views

How do I render a filled and stroked path using OpenGL?

I want to render a 2-dimensional geometric path consisting of Bézier curves and straight lines. Paths can be concave. What is the most efficient way to draw this using modern OpenGL? Can I do this ...
4
votes
2answers
467 views

How to create a scope for a sniper

I am developing a first-person shooter/strategy game using the Lightweight Java Game Library, which has support for OpenGL. I would like to create a sniper which I need to magnify the screen and ...
0
votes
1answer
498 views

Why does the lighting change the objects color?

I have a code that draws a sphere. Without lighting it is white, but if I enable lighting, it's drawn in gray. I don't know why the sphere changed it's color #include <GL/gl.h> #include ...
2
votes
1answer
259 views

Would I perform one pass per effect in Deferred Shading?

I'm implementing deferred shading the first time. Doing so I came up with a conceptual question. First I render the geometry in a framebuffer with muptiple rendering targets for depth, normals, and ...
1
vote
1answer
201 views

Skeletal Animation with UV seams

I have a UV-mapped model that I am about to animate and load into my game. Like most unwrapped models, I have several UV seams. In order to render the model correctly, I split each vertex along the ...
1
vote
1answer
794 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); ...
21
votes
2answers
3k views

After a succesful glLinkProgram, should I delete / detach my shaders?

After I have a linked program, and thinking about defensive programming, should I delete and detach the shaders used to link this program? If yes, is that going to free any resources? Or do these ...
3
votes
1answer
230 views

Can't get normals to work correctly with lighting in OpenGL [closed]

I'm trying to light up a simple 2d triangle with my cursor as a diffuse light source but can't seem to set the normal correctly for the lighting to look right. The function that calculates the normal ...
1
vote
1answer
859 views

How do I create geometry in SceneKit?

I have been experimenting with Apple's new SceneKit for fun, but I cannot seem to figure out how to input vertex data without loading a .dae file. Does anybody who has been testing SceneKit have any ...
0
votes
1answer
2k views

Rotating Objects in OpenGL: glRotate or Quaternions?

I'm coding my first engine and I'm trying to have performance in mind since I'll probably use it for mobiles, and I have this question, should you use glRotate or Quaternions for rotating objects in ...
2
votes
2answers
1k views

rpg 3d open world map & entity loading-streaming

Hello I'm a web developer and recently I started reading about game development. I followed some tutorials regarding c++ and openGL (whatever I could find online because as you know not many up to ...
0
votes
1answer
204 views

Is it possible to render part of the screen in different pixel density using openGL?

Say I have an openGL screen and I want to render part of the screen in different pixel density than the whole screen pixel density. Is it possible and if possible how?
2
votes
1answer
545 views

How to link OpenGL with my own static library?

My game project is split up into three parts: Core (lib) Editor (exe) Game (exe) I'm using OpenGL in both my Core and Game parts, but as soon as I try to call an OpenGL function in my Core library ...
2
votes
2answers
2k views

OpenGL vs DirectX difference from Graphics card perspective?

I want to know the difference in purely hardware level if there is any. For example the most simple question: Is there a chip for DirectX and another chip for OpenGL? What do hardware producers do to ...
2
votes
2answers
5k views

How to draw a smooth circle in Android using OpenGL?

I am learning about OpenGL API on Android. I just drew a circle. Below is the code I used. public class MyGLBall { private int points=360; private float vertices[]={0.0f,0.0f,0.0f}; private ...
32
votes
10answers
4k views

What makes a game look “good”? [closed]

I am working on a 3D space game using OpenGL and C++ and I am planning to focus on giving the game modern, eye-catching graphics, but the more I think of it the more I realise I don't really know what ...
0
votes
1answer
393 views

Changing Yaw, Pitch And Roll OpenGL

I'm using LWJGL and OpenGL 1.1 at this time and I was wondering what command is used to change the yaw, pitch and roll?
4
votes
1answer
1k views

OpenGL GLSL skinning problem

This time I've decided to ask a question related to my skinning problem. Two earlier ones were not really related to my problem and I've deleted them. Ok, first of all, I'm using OpenGL 3, 3ds max, ...
0
votes
1answer
1k views

Draw user interface in OpenGL using web technologies

I am developing a desktop game in C++ and OpenGL. Frameworks I use are GLM and SFML. Since today I used the console window for debug messages. But I want to get rid of that and display debug ...
0
votes
1answer
389 views

rotate sphere horizontally around another sphere

I currently have an earth and a moon. What I'm trying to achieve is to have the moon physically rotate around the earth horizontally along the equator along a circular path. moonAngle = ...
4
votes
1answer
528 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 ...