Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Sawiner

Member Since 09 Sep 2010
Offline Last Active Jan 24 2013 02:33 PM

Posts I've Made

In Topic: c++ D3D 11 DXGI Present in another thread - window not responding

24 January 2013 - 02:36 PM

iedoc - first of all, that makes a lot of sense. Thanks for that information.

That being said though, how is the render loop in another thread suppose to look like then?

Assuming i'm looking for a variable time step (so I can't base the loop on time), and no vsync.

 

I tried looking into getting the current monitor refresh rate, then limiting

the amount of draw calls to that, however as far as I can tell, there is no "secure"

(one that will always bring a result) method of doing such thing.

For example, EnumDisplaySettings() and DEVMODE structure ( http://msdn.microsoft.com/en-us/library/windows/desktop/dd183565(v=vs.85).aspx )

, say that if the value is 0, it uses the adapter default refresh rate. However, I can't seem to find a way to get

the adapter default refresh rate.

 

Also, is that a good idea? if not, how else should I do such thing?


In Topic: c++ D3D 11 DXGI Present in another thread - window not responding

22 January 2013 - 12:06 AM

iedoc - thanks for your reply.

 

I was wondering though, what makes the message loop lock the screen? I "watched" the messages,

and most of the time the messages the GetMessage() was stuck on were something like WM_NCACTIVATE

and WM_MOUSEFIRST - that is, messages that aren't related to paint.

 

Although, assuming the message pump does lock the screen, I agree with you - rendering from

another thread would be dangerous.

 

 

I have to say though, the documentation about DXGI and multi-threading make me thinks

as if what i'm trying to accomplish should be possible;

take a look here:

http://msdn.microsoft.com/en-us/library/windows/desktop/ee417025(v=vs.85).aspx#multithreading_and_dxgi

 

The multi-threading part there talks about deadlocks (which I have avoided, so far anyway).

That is, it implicity tells you it's ok to call Present() from another thread.

 

Few questions then:

1. so what am I missing here? how am I suppose to write a game that call Present() from another thread,

in a variable time step, without vsync (that is, fast as possible) ?

 

2. Assuming I do keep the Present() call in the UI thread, and does the rendering

in another thread, how do I know which parts Present() will draw and which not?

 

I know I can use synchronization primitives such as mutex, I am talking about a case

where I wouldn't use one, and wouldn't use D3D11_CREATE_DEVICE_SINGLETHREADED flag as well,

meaning I can call the methods from multiple threads.

 

 

p.s.

I also just found out if i'm calling Present(1, 0), it's working as well.

As far as I understood, this is vsync.

so as far as I can tell, the problem is when Present() need to actually draw(),

which happens a lot more without vsync (since vsync waits, if I understand correctly).

However, I do not wish to use vsync. I wrote this to hopefully, give some more helpful information.


In Topic: drawindexed: index buffer has not enough space!

10 December 2012 - 01:31 AM

Not a single comment? nor a confirmation about my case? anythig? ...

In Topic: OBB and SAT Question

17 March 2011 - 07:31 AM

I apologize ahead for bringing this thread up again, however I am facing with similar function and I think it will fit the best into here.

much like Raeldor (I think) , I am failing to understand how the projected radiuses of the cross product vectors are found;
I didn't saw any response to it on this thread too.

According to 'jyk' and 'Christer Ericson' , the general formula is:
r = e0|A0.N| + e1|A1.N| + e2|A2.N|


for the cross product of vectors uA0 and uA1, regarding the projected radius of a;


ra =
eA0 * |dot(uA0, N)| +
eA1 * |dot(uA1, N)| +
eA2 * |dot(uA2, N)|;


I believe the first line can be removed since N has a 90º angle with uA0 and cos(90) = 0 ...


regarding the second line:


N is (right handed cross product):

N.x = (uA0.y*uA1.z) - (uA0.z*uA1.y);
N.y = (uA0.z*uA1.x) - (uA0.x*uA1.z);
N.z = (uA0.x*uA1.y) - (uA0.y*uA1.z);

so further expanding the second line (ignoring the third one, for now)
eA1 * dot(uA1, N) = eA1 * (
uA1.x * (uA0.y*uA1.z) - (uA0.z*uA1.y) +
uA1.y * (uA0.z*uA1.x) - (uA0.x*uA1.z) +
uA1.z * (uA0.x*uA1.y) - (uA0.y*uA1.z)
);

To be honest, I even opened it further on, on a paper; I won't do it here though, since I didn't end up nowhere.
I do know in the table it listed that: ra = eA1 * |r20| + eA2*|r10|
hence the expanded value of dot(uA1, cross(uA0, uB0)) should be equal to r20.
however, in r20, we actually have dot(uA2, uB0);

I believe i'm missing something, but I can't find a direct connection between the 2 terms.
What am I missing then?

p.s.
I apologize for my notation in here; I'm not familiar with any better way to do so, not in a forum post anyway.

In Topic: Rotational Joint Constraints (using Quaternions)

10 September 2010 - 12:52 PM

DonDickieD - thanks for your reply.

I have to say I don't usually buy books, but then again I don't usually do this kind of math (which seem hard). Since you've both authored and edited it, let me ask you: is there any chance you can list the prerequisite for it? that is, "how much"(what subjects) math should I know/learn before attempting to read it?

Also, I was able to read the table of contents on your book in amazon.com ; there seem to be like the subject i'm looking for (quaternion based constraints) is chapter 9. Do I also need to learn the 8 chapters before it, or some of them?
If so, can you list the prerequisite math knowledge for them too?


Also note I prefer to find a free online solution. The reason is because I currently can't use my credit card to purchase items out of the country, and ordering seem to take over a month. I will however use it if I find no other solution, which seem to be like that so far, and if(or when) I will be able to read it.

Thanks, Matan.

PARTNERS