cnlohr / noeuclid

Non-euclidean GPU Raytraced Game
BSD 3-Clause "New" or "Revised" License
644 stars 48 forks source link

Figure out why the view totally breaks sometimes. #8

Open cnlohr opened 9 years ago

cnlohr commented 9 years ago

Some people want:

quatnormalize( LookQuaternion, newquat );

commented out. But, it does prevent the view from righting itself, and carrying through portals correctly.

jaredloomis commented 9 years ago

It would be nice to know who else is having this problem, because it only breaks on some systems.

I don't know what is relevant, but here are some of my specs:

phiresky commented 9 years ago

I have Arch x86_64 kernel 3.16, gcc, tcc and freeglut are the same for me.

I'd say it's because of your GPU not liking the shaders, they are very complex. Maybe this could be used to find out what's wrong.

cnlohr commented 9 years ago

I'm on an NVIDIA GPU - do both of you guys have the view issue?

I think I should valgrind the issue. Can one of you guys take a video of it failing?

phiresky commented 9 years ago

No, I do not, works fine for me.

cnlohr commented 9 years ago

Bump Fiendfan, can you post a video or pictures or anything?

jaredloomis commented 9 years ago

I should be able to post some video in a few hours.

jaredloomis commented 9 years ago

Here's a video and the trace file, for use with apitrace.

jaredloomis commented 9 years ago

In the video at about 0:20-0:30, I was holding down "w" and moving the mouse around. When the mouse is moved but no movement key pressed, it has no effect. When a movement key is pressed and then I move the mouse around, it moves me around slightly and cancels out most movement caused by pressing the key, but there is no rotation in either case.

cnlohr commented 9 years ago

That is very strange. I've never used apitrace, I'm going to try to give that a shot in the next few days. In the mean time, it would be helpful for you to print both quaternions around the normalize... So I can see what the numerical values are. That would be significantly easier.

jaredloomis commented 9 years ago

I'm not at my computer for a while, but I'm fairly sure I remember the quaternion values.

Before normalization, the quaternion is within a few tenths more or less than "0.5 0.5 0.5 0.5", depending on how much I moved the mouse. After normalization, the quaternion is always exactly "0.5 0.5 0.5 0.5". I will post the actual data when I am able to.

jaredloomis commented 9 years ago

After doing more tests, it seems that gpRotFwd->NewDirection and gpRotUp->NewDirection are always 0 0 0 0. I'm investigating in RTHelper.cpp to see if I can find out why.

cnlohr commented 9 years ago

I think that we can detect cases like this and reset the camera. Once reset, I would expect it to continue acting normally. For now, you can try to reset the quaternion to <0,0,0,1>