Perspective Camera functions incorrectly.

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

I'm giving an example as to where the issue of only one plane near/far is being used.
All perspective projections that I've ever seen use this same system. The zNear and zFar distances are to a plane perpendicular to the view vector. You're not showing me anything new.
You even said yourself that you found that gamemaker doesn't do it this way
No. I said the opposite of that. GameMaker does exactly the same thing that Irrlicht does. It applies a view and perspective projection matrix.
how can you say that none do
Because, as I've been trying to tell you, the problem is with perspective projection. If you use a perspective projection matrix the artifact you are complaining about will appear.
All of the perspective-based cameras are like this in that they only take into consideration the depth in the direction you're looking!
Yes. Not just the cameras in Irrlicht.
VioletAlixe
Posts: 28
Joined: Thu Oct 04, 2007 9:03 pm

Post by VioletAlixe »

Okay, regardless of what the other engines are doing, that article you sourced has no sources of its own that are reliable, and it even states so at the top. If you look at a "perspective corrected" picture, you get an otho view with depth in only one direction. Hence the current camera. It is useful if you want to design something without the interference of perspective (3d modeling for example). It however is not realistic in that our eyes and consequently our real cameras perceive in a "perspective distorted" manner.

EDIT: More importantly, not only is it not realistic, but it's also not accurate, because perspective is relative to all three planes. The current camera is a pseudo-perspective camera in that it mimics perspective. (Yes, it accurately replicates other "perspective projections" in use in many games today, but it does not replicate true perspective as seen in real life.)
hybrid
Admin
Posts: 14144
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

So then please give us a replacement metrix which provides a different, but still useful projection matrix. If we get just another one which can be chosen from those matrices it's fine. But we'd need to see a picture rendered in Irrlicht which shows some substantial difference to what we now have, and it must be useful for more than one person. Obviously, no one except you does understand what you're trying to do, respectively knows a way to overcome this limitation. So show us a way to overcome it (in Irrlicht!) and the rendered results.
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

[Oops, sorry for duping your post, hybrid]

Also, can you identify any games or applications that currently use a 'correct' perspective camera?
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
VioletAlixe
Posts: 28
Joined: Thu Oct 04, 2007 9:03 pm

Post by VioletAlixe »

Sure thing; let me compile a bunch of resources then and I'll post them all here when I'm certain I've done both the things you're asking for.
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

VioletAlixe..

I think your asking for a realistic lens simulation. Not sure the calculations made by the engine would reproduce that in detail. It's good enough for games and some applications. If you want that the system account for every details of the lens curvature/lens refraction index/light absortion/diafragm size... I don't think it's there.

But if you'd want to simulate a lens in the detail. You would have to work on some projection system that's will have to process this.

Do you know of any game that as that kind of realistic simulation the type you mention?
VioletAlixe
Posts: 28
Joined: Thu Oct 04, 2007 9:03 pm

Post by VioletAlixe »

Chris, please hold questions until I respond to the above. Yes it's do-able, in fact it's not very hard to do at all. -And yes, I know of some, which I'm going to list as a response to the second question. I'm going to post it all together soon.
sRc
Posts: 431
Joined: Thu Jul 28, 2005 1:44 am
Location: Salt Lake City, Utah
Contact:

Post by sRc »

you have a solution? I spent days messing with things to no avail when I last looked at this (bug report), gave me a headache
The Bard sRc

Blog | Twitter
VioletAlixe
Posts: 28
Joined: Thu Oct 04, 2007 9:03 pm

Post by VioletAlixe »

The Anaconda wrote:you have a solution? I spent days messing with things to no avail when I last looked at this (bug report), gave me a headache
To fix that weird look of the sphere, you have to correct Irrlicht's default FOV. Just set the FOV to (45 * irr::core::DEGTORAD). Should work fine. I'm still working on the matrices for the perspective though. - Also, once I do finish it, that artifact should no longer occur.
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

VioletAlixe wrote:
The Anaconda wrote:you have a solution? I spent days messing with things to no avail when I last looked at this (bug report), gave me a headache
To fix that weird look of the sphere, you have to correct Irrlicht's default FOV. Just set the FOV to (45 * irr::core::DEGTORAD). Should work fine.
Using a 45 degree FOV (and the same 1280x720 screen as the original).

Image
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
sRc
Posts: 431
Joined: Thu Jul 28, 2005 1:44 am
Location: Salt Lake City, Utah
Contact:

Post by sRc »

rogerborg wrote:
VioletAlixe wrote:
The Anaconda wrote:you have a solution? I spent days messing with things to no avail when I last looked at this (bug report), gave me a headache
To fix that weird look of the sphere, you have to correct Irrlicht's default FOV. Just set the FOV to (45 * irr::core::DEGTORAD). Should work fine.
Using a 45 degree FOV (and the same 1280x720 screen as the original).

Image
yep, thats why I went to altering the matrix, but could never get it to work
The Bard sRc

Blog | Twitter
VioletAlixe
Posts: 28
Joined: Thu Oct 04, 2007 9:03 pm

Post by VioletAlixe »

Alright, I've almost succeeded so far. I say almost in that I'm able to account for half the directions necessary for this perspective. I can't do the other half with a single matrix4. Working on it as I type. Will update soon.
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

Is there anything that we can do to help with progress on this?
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

Yes it's do-able, in fact it's not very hard to do at all.
Care to revise that answer?
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
VioletAlixe
Posts: 28
Joined: Thu Oct 04, 2007 9:03 pm

Post by VioletAlixe »

rogerborg wrote:
Yes it's do-able, in fact it's not very hard to do at all.
Care to revise that answer?
I've done it so far, but it required so many rewrites I can't recall all the files I had to change. You can't do it with a single view matrix, you have to change how it's specifically drawn to the screen by section. Which, mind you, ended up rendering too slow on my computer to be worth implementing.

I ended up just making it a pre-run-time vertex processor. If you want the formula to do so, I can give it to you all.

Just render the individual vertex at an additional distance on the z axis based on the distance formula times the strength of the lens.

Frankly, modern home computers can't handle a realistic reflex lens smoothly. However, if you'd like to see one in action, keep an eye out for the PS3 debut of FFXIII, where the CG is rendered in real time using one.


Sorry for the let down, folks.
Post Reply