Author Topic: Depth of Field Revisited  (Read 13127 times)

0 Members and 1 Guest are viewing this topic.

Offline Woolie Wool

  • 211
  • Fire main batteries
I think the whole "meters" calculations given by the game are all wrong. Let's blow the models up considerably and make the meters units bigger (i.e. everything is x% larger and x% faster).
16:46   Quanto   ****, a mosquito somehow managed to bite the side of my palm
16:46   Quanto   it itches like hell
16:46   Woolie   !8ball does Quanto have malaria
16:46   BotenAnna   Woolie: The outlook is good.
16:47   Quanto   D:

"did they use anesthetic when they removed your sense of humor or did you have to weep and struggle like a tiny baby"
--General Battuta

 

Offline Carl

  • Render artist
  • 211
    • http://www.3dap.com/hlp/
Quote
Originally posted by Sandwich
We should fly past them quickly - especially at +/- 100 meters per second! :p But the thing is, at 100m/s, we should seem to be moving a _lot_ quicker than we do - go ahead, try surface-skimming at 100m/s one day. It's like driving a car. A.... slow car. ;)


...only because the ship you are skimming is so big.

try this.

1. get a fighter that goes 50 m/s

2. go up against a fenris, which is supposively 286 meters

3. fly past it. make sure you're at 50 m/s during the whole skim. this means starting a few 100 meters behind it.

4. time how long it takes to go from bow to stern. if it takes 5.72 seconds, then the scale is correct.
"Gunnery control, fry that ****er!" - nuclear1

 

Offline Sandwich

  • Got Screen?
  • 213
    • Skype
    • Steam
    • Twitter
    • Brainzipper
Quote
Originally posted by Sticks
Again, I will reiterate, because it doesn't seem to be taking.

The effect of looking through a spyglass is caused by the reduction in your viewing angle to something very small, like 5 or 10 degrees.

You contradict yourself by saying that spherical distortion would help and then claim that the current has too much diagonal and spherical distortion (axonometric).

FOV is the only adjustable parameter in a perspective equation, as well as the only one that alters the compression or expansion of the percieved Z axis.


Sticks, there is a difference between camera zoom and perspective, as you seem to understand, but I'm not sure the rest do. The spyglass analogy uses zoom, which is something you SCP coders have given us to adjust. But the perspective issue - the lens diameter - is what I'd like to be able to mess with. I'm willing to put up with distortion from this, just like I'm willing to put up with an inverted POV with a negative zoom amount currently. Can we lay aside arguments over whether it will help or not and just implement it? Is it even possible to implement?

Quote
Originally posted by Carl


...only because the ship you are skimming is so big.

try this.

1. get a fighter that goes 50 m/s

2. go up against a fenris, which is supposively 286 meters

3. fly past it. make sure you're at 50 m/s during the whole skim. this means starting a few 100 meters behind it.

4. time how long it takes to go from bow to stern. if it takes 5.72 seconds, then the scale is correct.


I don't doubt that the scale of the ships relative to velocity in-game is correct. As a matter of fact, I never brought the scale up! I think that while having more details on a ship certainly does help, it's not the main problem, and is addressing a side-issue and not the core problem. Bsides, look at the Star Destroyers is TIE Fighter. You cannot call them "detailed" by any stretch of imagination today, but they still look enormous.
SERIOUSLY...! | {The Sandvich Bar} - Rhino-FS2 Tutorial | CapShip Turret Upgrade | The Complete FS2 Ship List | System Background Package

"...The quintessential quality of our age is that of dreams coming true. Just think of it. For centuries we have dreamt of flying; recently we made that come true: we have always hankered for speed; now we have speeds greater than we can stand: we wanted to speak to far parts of the Earth; we can: we wanted to explore the sea bottom; we have: and so  on, and so on: and, too, we wanted the power to smash our enemies utterly; we have it. If we had truly wanted peace, we should have had that as well. But true peace has never been one of the genuine dreams - we have got little further than preaching against war in order to appease our consciences. The truly wishful dreams, the many-minded dreams are now irresistible - they become facts." - 'The Outward Urge' by John Wyndham

"The very essence of tolerance rests on the fact that we have to be intolerant of intolerance. Stretching right back to Kant, through the Frankfurt School and up to today, liberalism means that we can do anything we like as long as we don't hurt others. This means that if we are tolerant of others' intolerance - especially when that intolerance is a call for genocide - then all we are doing is allowing that intolerance to flourish, and allowing the violence that will spring from that intolerance to continue unabated." - Bren Carlill

 

Offline aldo_14

  • Gunnery Control
  • 213
What is the current transformation matrix used for rendering?  And has anyone tried fiddling with it to increase the shrinkage in x,y with increasing z-depth?

(can't remember the actual name of the matrix i'm thinking of offhand....)

 

Offline IceFire

  • GTVI Section 3
  • 212
    • http://www.3dap.com/hlp/hosted/ce
This sounds really interesting...I agree with Sandwich...we should fly past them quickly.  This change would probably give many aspects a greater sense of speed even when the actual game speed has not changed at all (a largely balance thing).

Just a thought but Forgotten Battles uses hotkeys to shift the field of view from a very narrow (and thus sort of zoomed in) to the sort of fishbowl effect so you can see everything.
« Last Edit: December 21, 2003, 09:10:15 am by 18 »
- IceFire
BlackWater Ops, Cold Element
"Burn the land, boil the sea, you can't take the sky from me..."

 

Offline Sticks

  • 29
Sandwich, I'm not arguing, I'm trying to explain why it won't work, giving examples and techinical reasons so that people know why. I'm trying to be as curteous as possible here.

Computer games don't operate on lenses. Altering the diameter of a lens only alters the fov and focal length, which is the only reason a small or bigger lens has different perspective. Perspective is a function of fov only. Zoom is a decrease in fov.

Therefore, it can't be done. It is a physical and mathematical impossibility.
"Napalm is good as a quickfire solution, literally..." -- cngn

"Shh... [Kazan's] schizophrenia allows him to multitask." -- Goober5000

Why am I still coding at 12:35am?

SCP: Templum sanctus ingeniosus

 

Offline Flaser

  • 210
  • man/fish warsie
Sticks, I probably used the terminology without good enough understanding of it - what I said is that things don't look distorted enough, if you go parallel to an Orion it should shrink a lot more than it does, the sides are too straight.
"I was going to become a speed dealer. If one stupid fairytale turns out to be total nonsense, what does the young man do? If you answered, “Wake up and face reality,” you don’t remember what it was like being a young man. You just go to the next entry in the catalogue of lies you can use to destroy your life." - John Dolan

 

Offline Sandwich

  • Got Screen?
  • 213
    • Skype
    • Steam
    • Twitter
    • Brainzipper
Quote
Originally posted by Sticks
Sandwich, I'm not arguing, I'm trying to explain why it won't work, giving examples and techinical reasons so that people know why. I'm trying to be as curteous as possible here.

Computer games don't operate on lenses. Altering the diameter of a lens only alters the fov and focal length, which is the only reason a small or bigger lens has different perspective. Perspective is a function of fov only. Zoom is a decrease in fov.

Therefore, it can't be done. It is a physical and mathematical impossibility.


Sorry, I didn't mean to be that confrontational, but this is like the 4th time I've brought up this subject, and each time we get embroiled in discussions of all sorts of other ways to make things look bigger, and frankly, I've gotten sick of it.

But I must correct a glaring error in your post - computers - and therefore computer games - do operate on lenses - or lens simulation, to be accurate. If computers did not simulate different perspectives, then how did I get such different-looking renders?

ANYway.... can anyone actually look into this for once?
SERIOUSLY...! | {The Sandvich Bar} - Rhino-FS2 Tutorial | CapShip Turret Upgrade | The Complete FS2 Ship List | System Background Package

"...The quintessential quality of our age is that of dreams coming true. Just think of it. For centuries we have dreamt of flying; recently we made that come true: we have always hankered for speed; now we have speeds greater than we can stand: we wanted to speak to far parts of the Earth; we can: we wanted to explore the sea bottom; we have: and so  on, and so on: and, too, we wanted the power to smash our enemies utterly; we have it. If we had truly wanted peace, we should have had that as well. But true peace has never been one of the genuine dreams - we have got little further than preaching against war in order to appease our consciences. The truly wishful dreams, the many-minded dreams are now irresistible - they become facts." - 'The Outward Urge' by John Wyndham

"The very essence of tolerance rests on the fact that we have to be intolerant of intolerance. Stretching right back to Kant, through the Frankfurt School and up to today, liberalism means that we can do anything we like as long as we don't hurt others. This means that if we are tolerant of others' intolerance - especially when that intolerance is a call for genocide - then all we are doing is allowing that intolerance to flourish, and allowing the violence that will spring from that intolerance to continue unabated." - Bren Carlill

 

Offline jdjtcagle

  • 211
  • Already told you people too much!
I love this place.
anyway, I've ben reading through this and it's all a foreign language to me. But it would be extremely "great" accomplishment to fix this.  It's only a matter of time to understand. But thats the problem, if anyone can fix it, chances are there extremely buisy.:nod: :)
"Brings a tear of nostalgia to my eye" -Flipside
------------------------------------------
I'm an Apostolic Christian (Acts: 2:38)
------------------------------------------
Official Interplay Freespace Stories
Predator
Hammer Of Light - Omen of Darkness
Freefall in Darkness
A Thousand Years

 

Offline Sticks

  • 29
You got different looking renders because each render had a different viewing angle. That is all.

You can alter the degrees of fov by using the command line param -fov.

I will reiterate this for the last time. Fov is the ONLY variable in perspective, other than aspect ratio. Changing lens diameters only alters fov. Nothing else, nothing more.

-fov .5 will be about 40 degrees fov. -fov 1.5 will be about 120, I think. The current is 80 degrees.

Trust me, I looked into this just to make sure I wasn't spouting smoke, and there are no other alterations that can be made to a perspective equation other than the fov and aspect ratio. Period. Look in the various 3D SDKs if you don't believe me.

What you want to do is set up a test mission, and play with the -fov parameter until the distortion is how you want it. For your last render, I would recommend a -fov 1.25 or thereabouts. That would pretty much put you exactly on target with that last render's lens sim.
« Last Edit: December 21, 2003, 04:38:15 pm by 1354 »
"Napalm is good as a quickfire solution, literally..." -- cngn

"Shh... [Kazan's] schizophrenia allows him to multitask." -- Goober5000

Why am I still coding at 12:35am?

SCP: Templum sanctus ingeniosus

  

Offline Sticks

  • 29
Just to be thorough:

The proper fov and focal length equation is:

FOV = 2 arctan (x / (2 f))

Where f is the focal length (25mm, 200mm, etc.) and x is the diagonal of the surface (a screen, film, ccd, etc.).

They are proportional. Hence, any computer lens simulation will convert to fov when a focal length has been supplied, as the perspective projection matrix is:

Code: [Select]

w       0       0               0
0       h       0               0
0       0       zf/(zf-zn)      1
0       0       -zn*zf/(zf-zn)  0
where:
h is the view space height. It is calculated from
h = cot(fovY/2);

w is the view space width. It is calculated from
w = h / Aspect.



So there. :p
"Napalm is good as a quickfire solution, literally..." -- cngn

"Shh... [Kazan's] schizophrenia allows him to multitask." -- Goober5000

Why am I still coding at 12:35am?

SCP: Templum sanctus ingeniosus

 

Offline Sandwich

  • Got Screen?
  • 213
    • Skype
    • Steam
    • Twitter
    • Brainzipper
Quote
Originally posted by Sticks
You got different looking renders because each render had a different viewing angle. That is all.

You can alter the degrees of fov by using the command line param -fov.

I will reiterate this for the last time. Fov is the ONLY variable in perspective, other than aspect ratio. Changing lens diameters only alters fov. Nothing else, nothing more.

-fov .5 will be about 40 degrees fov. -fov 1.5 will be about 120, I think. The current is 80 degrees.

Trust me, I looked into this just to make sure I wasn't spouting smoke, and there are no other alterations that can be made to a perspective equation other than the fov and aspect ratio. Period. Look in the various 3D SDKs if you don't believe me.

What you want to do is set up a test mission, and play with the -fov parameter until the distortion is how you want it. For your last render, I would recommend a -fov 1.25 or thereabouts. That would pretty much put you exactly on target with that last render's lens sim.


I admit freely that I understand zero of the underlying equation, but my spatial comprehension is quite high. So pardon me for trying to explain this in visual terms and not equations. :p

EDIT Gah, too tired to explain properly. Read Aldo's post about the depth vs the width & height; methinks he was right on. The "perspective" adjustment in MAX, along with a change in FOV, made what used to look like it was X meters away appear to be twice as far.
SERIOUSLY...! | {The Sandvich Bar} - Rhino-FS2 Tutorial | CapShip Turret Upgrade | The Complete FS2 Ship List | System Background Package

"...The quintessential quality of our age is that of dreams coming true. Just think of it. For centuries we have dreamt of flying; recently we made that come true: we have always hankered for speed; now we have speeds greater than we can stand: we wanted to speak to far parts of the Earth; we can: we wanted to explore the sea bottom; we have: and so  on, and so on: and, too, we wanted the power to smash our enemies utterly; we have it. If we had truly wanted peace, we should have had that as well. But true peace has never been one of the genuine dreams - we have got little further than preaching against war in order to appease our consciences. The truly wishful dreams, the many-minded dreams are now irresistible - they become facts." - 'The Outward Urge' by John Wyndham

"The very essence of tolerance rests on the fact that we have to be intolerant of intolerance. Stretching right back to Kant, through the Frankfurt School and up to today, liberalism means that we can do anything we like as long as we don't hurt others. This means that if we are tolerant of others' intolerance - especially when that intolerance is a call for genocide - then all we are doing is allowing that intolerance to flourish, and allowing the violence that will spring from that intolerance to continue unabated." - Bren Carlill

 

Offline Sandwich

  • Got Screen?
  • 213
    • Skype
    • Steam
    • Twitter
    • Brainzipper
Just for the heck of it. The camera is in the same position in the first 3 pics.

85mm:



50mm:



28mm:


And finally, from the "I-Can't-Believe-It's-That-Big" department:



Yes, everything is to scale. And yes, that Ent-D model sucks. Sue me.
SERIOUSLY...! | {The Sandvich Bar} - Rhino-FS2 Tutorial | CapShip Turret Upgrade | The Complete FS2 Ship List | System Background Package

"...The quintessential quality of our age is that of dreams coming true. Just think of it. For centuries we have dreamt of flying; recently we made that come true: we have always hankered for speed; now we have speeds greater than we can stand: we wanted to speak to far parts of the Earth; we can: we wanted to explore the sea bottom; we have: and so  on, and so on: and, too, we wanted the power to smash our enemies utterly; we have it. If we had truly wanted peace, we should have had that as well. But true peace has never been one of the genuine dreams - we have got little further than preaching against war in order to appease our consciences. The truly wishful dreams, the many-minded dreams are now irresistible - they become facts." - 'The Outward Urge' by John Wyndham

"The very essence of tolerance rests on the fact that we have to be intolerant of intolerance. Stretching right back to Kant, through the Frankfurt School and up to today, liberalism means that we can do anything we like as long as we don't hurt others. This means that if we are tolerant of others' intolerance - especially when that intolerance is a call for genocide - then all we are doing is allowing that intolerance to flourish, and allowing the violence that will spring from that intolerance to continue unabated." - Bren Carlill

 

Offline Odyssey

  • Stormrider
  • 28
[color=cc9900]I don't know what you're trying to prove, Sandwich, but my analysis of those pictures is as follows:
All that is changing in those pictures is the field of view, in relation to the simulated focal length of the lens. Things appear to be further away because they now correspond to a lesser percentage of what the camera can see. The actual distance isn't changing a jot.[/color]

 

Offline Sandwich

  • Got Screen?
  • 213
    • Skype
    • Steam
    • Twitter
    • Brainzipper
Exactly - the distance isn't moving one bit. It seems to me that if we could set the engine to render at a simulated 28mm, and then somehow only displayed the center 50% or so of the image, at a full 1024x768 (or 640x480) resolution, we'd have the right field of view, as well as have the in-game models look quite large.
SERIOUSLY...! | {The Sandvich Bar} - Rhino-FS2 Tutorial | CapShip Turret Upgrade | The Complete FS2 Ship List | System Background Package

"...The quintessential quality of our age is that of dreams coming true. Just think of it. For centuries we have dreamt of flying; recently we made that come true: we have always hankered for speed; now we have speeds greater than we can stand: we wanted to speak to far parts of the Earth; we can: we wanted to explore the sea bottom; we have: and so  on, and so on: and, too, we wanted the power to smash our enemies utterly; we have it. If we had truly wanted peace, we should have had that as well. But true peace has never been one of the genuine dreams - we have got little further than preaching against war in order to appease our consciences. The truly wishful dreams, the many-minded dreams are now irresistible - they become facts." - 'The Outward Urge' by John Wyndham

"The very essence of tolerance rests on the fact that we have to be intolerant of intolerance. Stretching right back to Kant, through the Frankfurt School and up to today, liberalism means that we can do anything we like as long as we don't hurt others. This means that if we are tolerant of others' intolerance - especially when that intolerance is a call for genocide - then all we are doing is allowing that intolerance to flourish, and allowing the violence that will spring from that intolerance to continue unabated." - Bren Carlill

 

Offline Sticks

  • 29
Thank you god. Somebody else who understands. I'm not sure why this is even being discussed still. The proper adjustment can be made with the command line param -fov.

End of story. Period. Fullstop. The bottom line. The final word. Fin.
;)
"Napalm is good as a quickfire solution, literally..." -- cngn

"Shh... [Kazan's] schizophrenia allows him to multitask." -- Goober5000

Why am I still coding at 12:35am?

SCP: Templum sanctus ingeniosus

 

Offline Sandwich

  • Got Screen?
  • 213
    • Skype
    • Steam
    • Twitter
    • Brainzipper
The -fov command line, for reasons unknown to me, does not bring about the effect FS2 needs. Ships look larger when the "camera" is "zoomed in", which is an obvious result. But they look larger not because of the perspective (which flattens out), but because of the fact that they simply take up more screen space.

But I do see what you mean when you say that the fov is the only variable we have to adjust. While playing with the "perspective" control in MAX, I saw that, while it would lower the lens diameter, it would also move the camera closer, so that the actual field of view, what you could actually see, wouldn't change.

ANYway, here's an example of my idea from the above post:



The above is a 1600x1200 image, with a lens diameter of 28mm. The red is the part I cropped it to:



Compare this to the same visible area, but at 85mm:



As you can see, this would avoid distortion at the sides of the screen at wide lens angles, while allowing FS2 ships to appear much closer to their real size.
SERIOUSLY...! | {The Sandvich Bar} - Rhino-FS2 Tutorial | CapShip Turret Upgrade | The Complete FS2 Ship List | System Background Package

"...The quintessential quality of our age is that of dreams coming true. Just think of it. For centuries we have dreamt of flying; recently we made that come true: we have always hankered for speed; now we have speeds greater than we can stand: we wanted to speak to far parts of the Earth; we can: we wanted to explore the sea bottom; we have: and so  on, and so on: and, too, we wanted the power to smash our enemies utterly; we have it. If we had truly wanted peace, we should have had that as well. But true peace has never been one of the genuine dreams - we have got little further than preaching against war in order to appease our consciences. The truly wishful dreams, the many-minded dreams are now irresistible - they become facts." - 'The Outward Urge' by John Wyndham

"The very essence of tolerance rests on the fact that we have to be intolerant of intolerance. Stretching right back to Kant, through the Frankfurt School and up to today, liberalism means that we can do anything we like as long as we don't hurt others. This means that if we are tolerant of others' intolerance - especially when that intolerance is a call for genocide - then all we are doing is allowing that intolerance to flourish, and allowing the violence that will spring from that intolerance to continue unabated." - Bren Carlill

 

Offline Carl

  • Render artist
  • 211
    • http://www.3dap.com/hlp/
okay, good. someone do it.
"Gunnery control, fry that ****er!" - nuclear1

 

Offline Solatar

  • 211
Quote
Originally posted by Carl
okay, good. someone do it.

 

Offline Odyssey

  • Stormrider
  • 28
[color=cc9900]What you've effectively done, looking at the linear length of that red box in relation to the original image, is halved it. This is the photographic equivalent of doubling the focal length of the lens to ~56mm, and is something regularly done on enlargers when making a print.

This means that your 85mm ought to appear much closer than it is, if you were doing judgement from the same distance (which is what would be happening in FS2). Try comparing your resulting cropped image to one taken with a 56mm from the same point, and they ought to look exactly the same. Did you change the distance for that 85mm picture, or is it something MAX did automatically?

I still don't get what you're trying to achieve. If you want things to look big, you go right up close to them with a 28mm. If you want things to look big from a distance, you use an 85mm. Perspective is related to distance, not focal length, hence with the 28mm upclose you will see a lot of distortion compared to the 85mm from a distance.

Therefore, since distance is something that is changed by flying around in FS2, the only thing we should change is focal length. If you want your 'cropped effect' photo, make your FOV something equivalent to a 56mm.

EDIT:[/color]
Quote
Originally posted by Sandwich
While playing with the "perspective" control in MAX, I saw that, while it would lower the lens diameter, it would also move the camera closer, so that the actual field of view, what you could actually see, wouldn't change.

[color=cc9900]Ah right, so it is something MAX does. Just to clarify though, it's not changing the lens diameter, it's changing the focal length. If you change the lens diameter in a camera, i.e. the aperture, then you'll be using smaller film, have less lens resolution, and have a longer depth of field. Everything else would be equivalent.[/color]
« Last Edit: December 25, 2003, 06:53:19 am by 493 »