Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 22 Aug 2011
Offline Last Active Jan 08 2016 08:15 PM

Posts I've Made

In Topic: Banding artefacts (caused by attenuation?)

07 January 2016 - 10:54 PM

Yes, I also thought about dithering, I just wanted to make sure I didn't miss something obvious (like the colour picker trick... Simple, awesome, effective and totally made me drop my jaw since I couldn't come up with it myself biggrin.png).


Well now that I know for sure that it's the discretization when rendering to the window's back buffer, I can do things again, thanks a lot!


So I guess the banding is visible in darker images, due to the contrast enhancement for darker regions in the human vision? I think I heard something familiar to this in a lecture about visualization...




Last time I heard something about 30bit colordepth it was 2009 when Nvidia released some paper about the Quadro series to support it, thanks for the reminder, too.

In Topic: Stencil Clear doesn't work

03 January 2015 - 11:25 AM


Try adding glStencilMask(0xff) before your glClear call.

If nothing else happend this should be initialized to 0xFF...


If you are clearing a FBO's stencil buffer you might as well try out glClearBufferiv (GL_DEPTH_STENCIL, buf, depth, stencil) and see what happens.

In Topic: scene graph render order

03 January 2015 - 08:12 AM

Nice, that's sufficient for a start. I guess I can be creative on this one - like doing things in parallel.

In Topic: scene graph render order

03 January 2015 - 07:33 AM

Thanks! This is very appreciated.

I guess I expressed myself not quite accuratly by mentioning the term scene graph (I know what this is and only mentioned it because I'm calculating buckets for my objects while traversing and updating) I just wondered about the priorities...


@L. Spiro: Are there any further sources you can recommend on how to exploit the temporal coherence? That sounded very promising and interesting to try out.

In Topic: Texture issue with different PC's

01 January 2015 - 03:05 PM

First of all I would suggest to define your transformation matrices as uniform parameters (at some point you'd have to do this anyway).

so your vertex shader might look like this:

#version 330

uniform mat4 ModelMatrix;
uniform mat4 ViewMatrix;
uniform mat4 ProjMatrix;
uniform mat4 NormalMatrix;

in vec3 Position;
in vec3 Normal;
in vec2 Texcoord;

out vec3 px_position;  // for lighting in viewspace
out vec3 px_normal;    // for lighting in viewspace
out vec2 px_texcoord;

void main () 
	// transform into viewpace
	gl_Position = ModelMatrix * vec4 (Position, 1.0);
	gl_Position = ViewMatrix * gl_Position;
	px_position = gl_Position.xyz;
        // project
	gl_Position = ProjMatrix * gl_Position;

	px_normal = (NormalMatrix * vec4 (Normal, 0.0)).xyz;
	px_texcoord = Texcoord;

You then want to set up the Model, View and Projection matrices in the host app (the Normal matrix is the inverse transposed of the Modelview matrix, this has something to do with scale operations are not affine transformation, for now i'd just ask you to accept it as it is or check out the math biggrin.png)

If you do not want to implement lighting in your fragment shader feel free to omit the normals for now...


I'd reccomend you to check out this tutorial for how to set up your matrices correctly:



Either way scaling is an operation you are performing in object space, which yields that it is part of your Modelmatrix.



They must be loaded from a file



That is harsh but I like it biggrin.png

Doing this also yields the advantage of code completion and syntax highlighting. fyi: I once made the super include for glsl syntax, which defines all the types and functions, just tell your c++ compiler glsl-files are to treat as cpp headers and all the sweet benefits of autocompletion and stuff are ready for your glsl code.

Check it out: https://github.com/Wh0p/Wh0psGarbageDump/blob/master/syntax