3D Model Viewer - G-Sensor [NEW 2.0]

Search This thread

andrec

Member
Aug 16, 2008
32
0
Couple things I'd also try:

Override OnPaintBackground and remove the base.OnPaintBackground call. There's no point using OnPaintBackground in GDI if D3D is painting. It can cause flickering.

Also, instead of using Device.Clear to clear the background, perhaps try using a polygonal colored/textured background? Device.Clear used to cause flickering behavior on some computer video cards. I think it has something to do with a device Clear not being a true render call, and handled as an asynchronous memset, which causes issues with making render calls immediately after the Clear. Another common workaround was to Clear the device AFTER the buffers were swapped, and not immediately before painting. The reason that works "better" is because the memset is given more time to complete before the next set of render calls are made. At least that's how it worked ~7 years ago when I was working on the Direct3D team...

I have been trying to reproduce this bug in OpenGL, and can't get it to happen anymore: my code doesn't do either of the things I mentioned.

I will try and see if I can get it better. You would think that those samples did it right :)

Most MSDN samples and other apps I've tried have this issue, so that's why I tend to see it as a driver problem.

And Koush, admit it, the actual reason you disassembled the code was to see if I used your sensor sdk :D
 

Koush

Retired Recognized Developer
Sep 21, 2007
917
872
I will try and see if I can get it better. You would think that those samples did it right :)

Most MSDN samples and other apps I've tried have this issue, so that's why I tend to see it as a driver problem.

And Koush, admit it, the actual reason you disassembled the code was to see if I used your sensor sdk :D

Haha, no, I really was just looking to see what swap effect you were using.
 

Wolfer_CZ

New member
Apr 5, 2008
2
0
Pretty cool. Is anybody here who wants to make a pokédex? :D :D :D
But seriously, 3D tamagotchi like this would be AWESOME! :)
 

andrec

Member
Aug 16, 2008
32
0
I noticed during development that the v-sync problem goes away if you connect the device to your computer (activesync). If I restart the device, it's back. Anyone can confirm this?
 

NLS

Senior Member
May 27, 2005
2,496
63
Piraeus
www.ilogic.gr
I cannot really confirm this. I just did the test. I think the refresh (the FPS probably) gets a bit lower so you perceive it as smoother. I think this is what happens in my device.

In any case if THAT is what happens, I don't like what we discovered.

Anyway I have two other things to note for V2.0:

1) Please smooth the sensor values... the graphic trembles even if you lay the device on a table!

2) Position of the mesh in 3D space feels wrong. You can't look the tiger in the eye when the device is face up and look the tiger from the top, then you hold the device in front of you!

3) (bonus :D) When you hold the device directly in front (and the beast is seen from the top - which I disagree as you see in #2), in fact it goes nuts, because in very small value changes in this angle you change from seeing the device looking down or up... You (or all of us) have to think of a better reaction in the device position eh?
 

andrec

Member
Aug 16, 2008
32
0
I cannot really confirm this. I just did the test. I think the refresh (the FPS probably) gets a bit lower so you perceive it as smoother. I think this is what happens in my device.

In any case if THAT is what happens, I don't like what we discovered.
Yes, I noticed that the FPS got lower, but if you zoom in the model it is very obvious that the v-sync problems almost disappear.
I tried to insert a delay in the code to force a lower FPS, but that did not help as the activesync did.

Anyway I have two other things to note for V2.0:

1) Please smooth the sensor values... the graphic trembles even if you lay the device on a table!

2) Position of the mesh in 3D space feels wrong. You can't look the tiger in the eye when the device is face up and look the tiger from the top, then you hold the device in front of you!

3) (bonus :D) When you hold the device directly in front (and the beast is seen from the top - which I disagree as you see in #2), in fact it goes nuts, because in very small value changes in this angle you change from seeing the device looking down or up... You (or all of us) have to think of a better reaction in the device position eh?
#1 is fixed.
#2 and #3 is due to how the g-sensor works. If you have the device front, it doesn't output any rotation changes.
 

itsallsubliminal

Senior Member
Nov 20, 2007
933
44
i saw a hologram 3d program for the iphone, with an animated character walking...

it would be real cool if the T-rex was "on the prowl" as you rotated him and such!

btw, i'm getting the flickering too, seems like the app is SUPER sensative to the g-sensor...

this is a cool lil app tho, love it!