Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Member Since 09 Dec 2012
Offline Last Active Aug 31 2014 07:24 AM

Posts I've Made

In Topic: Per-pixel displacement mapping GLSL

04 May 2014 - 03:51 AM

Actually i have no idea why it works. But it works when i do NOT normalize the view and light direction in the VS.

So instead of this:

vec3 fvViewDirection  = normalize( uCameraDirection - posObject.xyz);
vec3 fvLightDirection = normalize( uLightPos.xyz - posObject.xyz );

I got this now:

vec3 fvViewDirection  = uCameraDirection - posObject.xyz;
vec3 fvLightDirection = uLightPos.xyz - posObject.xyz;

Here is a final video:

In Topic: Per-pixel displacement mapping GLSL

03 May 2014 - 09:11 AM

Unfortunately no change. I tried that already before, the uModel matrix is in fact only a idently matrix at the moment.


Some more suggestions from my side:


In Topic: Per-pixel displacement mapping GLSL

03 May 2014 - 04:21 AM

When I´m flipping the binormal, the effect is more visibile at the other side of the quad.

In general it seems to me, that the uv coordinates are "moved" a little bit when im getting closer and therefore the texture is not applied correctly anymore.


Attached File  5.jpg   164.85KB   2 downloads


I also added a video http://paxi.at/random/sfg_com.avi

In Topic: Per-pixel displacement mapping GLSL

02 May 2014 - 09:08 AM

Thank for your suggestion.

My camera direction was really inverted, but I invert it in the TraceRay method again (

vec2 dUV = - dir.xy * height * 0.08;

dir is the cameradirection in tangent space.


I tried changing to 

normalize( posObject.xyz - uCameraDirection );

and without inverting in the TraceRay method but I get the same result unfortunately :(

In Topic: getting pixel format with wglChoosePixelFormatARB

10 February 2013 - 04:45 PM

Thank you very much. I just started with OpenGL but wanted to port my old Windows System class first, I used with my DX9 framework before getting into OpenGL itself so i did not know about that. It seems that immediate mode rendering stopped working with 3.2. Creating a render context >= 3.2 causes my screen to stay black.