Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 09 Jun 2008
Offline Last Active Feb 28 2014 10:43 AM

Topics I've Started

Per pixel lighting with GLSL

27 February 2014 - 09:24 AM



I am very new to GLSL and trying to implement a simple per-pixel lighting. I found a lot of resources on the internet that even propose pixel shader and fragment shader code for this, but something is always wrong: the "default" pixel and fragment shader code is missing it seems (I get pixels that are individually lit, but everything is very dark, only one light supported, colors are strange). So it seems that a shader is just a piece of a puzzle, and should be combined with other components. But how? Or where can I find the code for a per pixel lighting shader, that supports my 8 lights and will basically render my scene as previously (except for nicer per-pixel lighting)?

Is it that difficult to have a simple per-pixel shading in openGL?


Adjacent camera display slightly different colors for same view patch

25 February 2014 - 10:44 AM



I have 6 cameras, each with a view angle of 90 degrees, arranged orthogonaly. That allows me to create a spherical camera view, once a mapping between the 6 views to a texture has been decided.


That all works well, but depending on the camera orientations, I can sometimes notice that adjacent cameras can display slightly different colors when rendering a same scene patch. How can that be? My 6 cameras have exactly the same settings.


Following is a picture that shows the 6 views, and the resulting spherical view. In red the color differences. It has to be noted that the color differences do not depend on the camera, but on the orientation of the 6 cameras.


Thanks for any insight!



conditional statement + automatic clean-up in preprocessor command

17 December 2013 - 12:31 PM



I wish to have a conditional statement, followed immediately by an object instanciation that will automatic clean-up at the end of a scope, a little bit similar to following example:

if (conditionRealized)
    // do something

which effectively would translate into something like:

if (conditionRealized)
    DummyObject dummy(initializationType);
    // do something

in above example, the destructor of dummy can automatically clean-up various things.

I have to place such a construct into several hundreds of functions, and I wish to simplify the task with a preprocessor command, so that I will be able to write:

    // do something

but above construct does obviously not work, since the scope comes after the preprocessor command.

I could use a preprocessor like:

#define IF_CONDITION_REALIZED_THEN if(conditionRealized) { DummyObject dummy(initializationType);

in order to write my code like:

    // do something

but my code editor doesn't like this (puts wrong indents), and it looks ugly.


Any idea?


Or, to present my problem in a different light:


I have a condition, that if passed, needs to make sure something is executed at the end of the scope, similar to this example:

if (canLockOtherThreads())
    // do something

GL_DEPTH24_STENCIL8_EXT not working ok on NVidia and Intel. ATI doing fine

30 September 2013 - 03:24 AM



I am having compatibility issues between graphic cards, when using FBO and stencil buffers: it only works correctly on ATI cards, NVidia (GeForce GT 620) and Intel (HD Graphics 4000) fail (they operate as if the stencil buffers were not enabled). I made sure I had the last drivers. Any idea what I am doing wrong, or what is going on?

Here my code:




The FBO functionality works fine with all tested graphic cards. Only the stencil buffer functionality fails with above mentionned graphic cards.


Thanks for any insight.


24 June 2013 - 08:09 AM



Does anyone have experience with openRTRT? It is a real-time raytracer, but I am afraid it was bought-up by the people behind open Inventor. Am I right?

Why I am asking is because I am (still) surveying various options to include a raytracer into my application. It seems openRTRT is very fast (it is often called real-time raytracer), but unfortunately I can't find much information about it on the internet.