Very very crazy problem :(

Started by
21 comments, last by WuTz 14 years, 2 months ago
So... I made a test. The AspectRatio is NOT the problem. Both
are different.
I found out, that even sprites are clipped out!
I mean they are clipped at the size from the main viewport.
They are resizing to, and the clipping-border is EXACTLY sized like
the Main-Viewport.

Do you need a screenshot of that?

And the more important thing:
Do you know how to solve that?? :(

I'll give you ANY code you need. Just ask which code!

:( :( :(
Advertisement
I'm with Evil Steve.

When I have this kind of problem, and I do very often, I get down to crunching my own numbers. Put hard-coded values in every relevant place and see how it affects your output.
Ok. I hardcoded the AspectRatio to 1, but it doesn't helps.
And I made a new screenshot, which shows everything you need to know:

http://i48.tinypic.com/2hmes5u.jpg

Maybe you know NOW, what could be wrong...
Have you tried using Pix to check that the projection matrix you think is being set, and you're definitely not setting the same projection matrix on both swapchains?

It still looks like an aspect ratio problem because in your latest screenshot they both have the same aspect ratio. If the bug was still there, they'd look different at the same aspect ratio surely?
Oh no!
Sorry, I set them both to 1.
I'll make a new one :)

PIX doesn't works. I don't know why. It says, that the Backbuffer isn't matching
the Window, but when I start without PIX everything is OK. I may open another thread because of that.

Look:
http://i49.tinypic.com/33ygn4p.jpg

The left is set to 1 and the right is set to 3.

Uhm. Look at the clipping border. How could the Aspect ratio do THIS?
Quote:Original post by WuTz
Look:
http://i49.tinypic.com/33ygn4p.jpg

The left is set to 1 and the right is set to 3.

Uhm. Look at the clipping border. How could the Aspect ratio do THIS?
What clipping border? The aspect ratio in the right-hand window is clearly the same as the aspect ratio on the left, which means the wrong projection matrix is being set for it.
They are NOT the same. I just HARDCODED them accidentally in that Screenshot.
But I made a NEW ONE! Look at my last posting! I set the leftone to 1 and the rightone to 3 in that shot. And (1 != 3) :)

I made one more shot, to show you the clipping:

BEFORE (To big to clip):
http://i48.tinypic.com/5dp4zb.jpg

AFTER (Clipping the text):
http://i45.tinypic.com/34q8dja.jpg

EDIT:
I checked this:
V((*Out)->ProjectionVariable->SetMatrix( ( float* )Projection ));

It returns S_OK, and the adress of the Matrix-Pointer is the right one. :(
When nothing goes anymore, I may could send you the engine. But actually we don't want to give it around...
I still don't see what you mean - Do you mean that the text isn't being scaled? If so, and you're using ID3DXFont, that's because ID3DXSprite (Which ID3DXFont) uses sets its own projection matrix when you draw using it.

I'm sure you're setting a different aspect ratio, but that aspect ratio is not in the projection matrix that is applied at the time the tree is rendered in the second window.

EDIT: Are you sure the projection matrix isn't being set again at some later point?
When you look at the second screenshot, you see, that the MainViewport is
veryvery small. And when you look at the right viewport, you see, that the
text isn't fully drawn. Don't think, that I reduced the Text! It is still the same text as in the "BEFORE"-Screenshot, in both viewports.

And see: The Main viewport has the SAME size as the drawn text in the right viewport! Thats what I mean with clipping. When I resize the Main viewport,
the clipping of the text moves with the size of the MainViewport.

It has the same X and the same Y size. Can THAT be done with the AspectRatio???
Quote:Original post by WuTz
When you look at the second screenshot, you see, that the MainViewport is
veryvery small. And when you look at the right viewport, you see, that the
text isn't fully drawn. Don't think, that I reduced the Text! It is still the same text as in the "BEFORE"-Screenshot, in both viewports.

And see: The Main viewport has the SAME size as the drawn text in the right viewport! Thats what I mean with clipping. When I resize the Main viewport,
the clipping of the text moves with the size of the MainViewport.
I see. Are the viewport extents also definitely being set?

When you use ID3DXSprite, it grabs the current viewport and uses that to set up a projection matrix. In the screenshots you've posted, it looks like ID3DXSprite thinks the viewport is smaller than it actually is. If that's the case, then the aspect ratio is probably also incorrect.

This topic is closed to new replies.

Advertisement