Jump to content

  • Log In with Google      Sign In   
  • Create Account

Paxi

Member Since 09 Dec 2012
Offline Last Active Apr 19 2015 02:23 AM

Posts I've Made

In Topic: Measuring frame time with AFR enabled

28 March 2015 - 07:34 AM

Thanks for your input!
You may be talking about that slides: http://developer.download.nvidia.com/whitepapers/2011/SLI_Best_Practices_2011_Feb.pdf right?

I am quad buffering my queries in the meanwhile (code is not final yet but works for a hardcoded quad buffered example)

template<size_t QueryCount>
		class BufferedAsyncTimer {
		public:
			void init() {
				mFirst = 0;
				mSecond = 1;
				mThird = 2;
				mFourth = 3;

				glGenQueries(QueryCount, mQueries[mFirst]);
				glGenQueries(QueryCount, mQueries[mSecond]);
				glGenQueries(QueryCount, mQueries[mThird]);
				glGenQueries(QueryCount, mQueries[mFourth]);
			}

			void start() {
				glBeginQuery(GL_TIME_ELAPSED, mQueries[mFirst][0]);
			}

			void stop() {
				glEndQuery(GL_TIME_ELAPSED);
			}

			double getElapsedTimeMS() {
				GLuint64 result;

				glGetQueryObjectui64v(mQueries[mFourth][0],
					GL_QUERY_RESULT, &result);


				if (mFirst == 0) {
					mFirst = 3;
					mSecond = 2;
					mThird = 1;
					mFourth = 0;
				}
				else if(mFirst == 1) {
					mFirst = 0;
					mSecond = 3;
					mThird = 2;
					mFourth = 1;
				}
				else if (mFirst == 2) {
					mFirst = 1;
					mSecond = 0;
					mThird = 3;
					mFourth = 2;
				}
				else if (mFirst == 3) {
					mFirst = 2;
					mSecond = 1;
					mThird = 0;
					mFourth = 3;
				}

				return static_cast<double>(result) / 1000000.0;
			}

		private:
			GLuint mQueries[4][QueryCount];
			GLuint mFirst, mSecond, mThird, mFourth;
		};

The frame time when measuring with AFR enabled is not slower anymore but exact the same speed as with single GPU.
However the FPS increases from ~600 (single) to ~930 even when receiving the results (so there should be no stalls anymore). Guess there is still a little thing I am missing...


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:
http://www.paxi.at/random/final.avi


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   10 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 :(


PARTNERS