• Advertisement
Sign in to follow this  

Faking viewvision

This topic is 4485 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I have a controllerable creature that has its eye on the side of the heads (I.E. Rabbit, Horse or Cameleon). You can switch to First-person mode and here I would like to also change the view to the view of a rabbit/horse/cameleon. Is this doable/possible with HLSL, if so where should I start to learn how? Thanks in advance, -Xeile

Share this post


Link to post
Share on other sites
Advertisement
huhu, that would be quite fun ^^

Well, one solution could be to increase the FOV (field of view if I'm not mistaken) to simulate a wider view (usually, the FOV is 90° or so. Using 180° gives a pretty cool effect that could fit what you need)

Or you could have 2 seperate renders, one for each eye.

But I don't really think you'll need HLSL for that.

Share this post


Link to post
Share on other sites
EDIT: Just too slow today [lol]

Couldn't you just tweak the 'Field Of View' for the projection matrix? make it somewhere around 160-180 degrees?

Just from basic biology I seem to remember that was the advantage to having eyes on the side of the head (for non-predators)...

Anyway, for implementation, if you can do it via the projection matrix - just alter the mWorldViewProj (or similar) constant you pass in?

hth
Jack

Share this post


Link to post
Share on other sites
I guess that depends on the creature you´re going to take control of, but generally it should be just a matter of tweaking the field of view value? On the other hand you could also try some kind of split-screen for "extreme" setups (like a bird for example). A bird´s eyes nearly don´t have a common field of view, you you could render the view of the left eye onto the left half of the screen, the right eye´s view onto the right half of the screen. Of course that would double any operations you´re doing to cull your scene.
You could also try to do a HLSL shader that does the following:
Given two view matrices (one for left eye and one for right eye), you calculate two transformed positions of every point. Then you could (at least with PS2.0 IIRC) discard one position based on the clip space coordinates you get and only show the one you need. That way you would do only one "culling pass". Don´t know if this is feasible though.

The player will definitely be confused with a bird´s view of the world, so this might be too extreme. Tweaking the FOV parameter is definitely more playable ;)
Good luck!

Share this post


Link to post
Share on other sites
Quote:
Original post by jollyjeffers
EDIT: Just too slow today [lol]

Couldn't you just tweak the 'Field Of View' for the projection matrix? make it somewhere around 160-180 degrees?

Just from basic biology I seem to remember that was the advantage to having eyes on the side of the head (for non-predators)...

Anyway, for implementation, if you can do it via the projection matrix - just alter the mWorldViewProj (or similar) constant you pass in?

hth
Jack


A disadvantage that non-predators have, is that they don't see depth, something I also have fake. So I think I have to use 2 orthogonal cameras.

If I succeed in this, I might use 3 cameras (2 Orthogonal, 1 perspective) to fake the sence of depth in the middel of the screen.

Share this post


Link to post
Share on other sites
Quote:
Original post by matches81
I guess that depends on the creature you´re going to take control of, but generally it should be just a matter of tweaking the field of view value? On the other hand you could also try some kind of split-screen for "extreme" setups (like a bird for example). A bird´s eyes nearly don´t have a common field of view, you you could render the view of the left eye onto the left half of the screen, the right eye´s view onto the right half of the screen. Of course that would double any operations you´re doing to cull your scene.
You could also try to do a HLSL shader that does the following:
Given two view matrices (one for left eye and one for right eye), you calculate two transformed positions of every point. Then you could (at least with PS2.0 IIRC) discard one position based on the clip space coordinates you get and only show the one you need. That way you would do only one "culling pass". Don´t know if this is feasible though.

The player will definitely be confused with a bird´s view of the world, so this might be too extreme. Tweaking the FOV parameter is definitely more playable ;)
Good luck!


I simulated this feature within 3ds max (with alot of trouble), and it isn't that confusing, it very cool cause you can see sooo much more. You just got to get used to it for a couple of seconds.

Share this post


Link to post
Share on other sites
Quote:
Original post by Xeile
A disadvantage that non-predators have, is that they don't see depth, something I also have fake. So I think I have to use 2 orthogonal cameras.

I know it's true of the human eye, but not sure of animals... but our peripheral vision is actually quite low detail and limited in colour (due to distribution of rods/cones iirc). Maybe another aspect for your effect could be that areas to the extreme of the view appear more "washed out" ?

Quote:
Original post by Xeile
If I succeed in this, I might use 3 cameras (2 Orthogonal, 1 perspective) to fake the sence of depth in the middel of the screen.

From a purely design point of view, be careful about the "user experience". A long time ago I made a game where (entirely by accident) it had a much larger FOV - and whilst it never bothered me, a few people that play-tested it commented on the effect being a bit "motion sickness" like [lol]

I think that was all to do with the way that with fast/panning movement and a wide FOV some objects can almost appear to bend/distort - which just looks wrong to the human eye...

hth
Jack

Share this post


Link to post
Share on other sites
Quote:
Original post by jollyjeffers
From a purely design point of view, be careful about the "user experience". A long time ago I made a game where (entirely by accident) it had a much larger FOV - and whilst it never bothered me, a few people that play-tested it commented on the effect being a bit "motion sickness" like [lol]

I think that was all to do with the way that with fast/panning movement and a wide FOV some objects can almost appear to bend/distort - which just looks wrong to the human eye...

hth
Jack


Yeah, this is indeed something I should be careful about... Maybe I should test it on my sisters first...

Thanks for this input.

Share this post


Link to post
Share on other sites
hmm... IIRC Alien vs Predator did something similar when you controlled the alien. I was completely unable to accomodate to the increased FOV, while others just loved it.
But I don´t think an increased FOV would be anywhere close to realistic for an animal with eyes at the sides of the head. Your setup with the 2 orthogonal and 1 perspective camera sounds closer to that, though I don´t see a reason for the orthogonal projection and the additional perspective camera? Shouldn´t 2 perspective views suffice?
Perhaps you could also try to blend the 2 views together in the center of the screen, where they also should be quite blurred because the center of the screen (in front of the creature) would be their "peripheral" field of view. IIRC birds are close to blind in front of their heads, at least at close range.

Share this post


Link to post
Share on other sites
Quote:
Original post by matches81
hmm... IIRC Alien vs Predator did something similar when you controlled the alien. I was completely unable to accomodate to the increased FOV, while others just loved it.

Yeah, I remember that effect. Maybe I was just rubbish at the game, but I ended up running round in circles and generally dying a lot when I had that alien view [lol]


Quote:
Original post by matches81
I don´t see a reason for the orthogonal projection and the additional perspective camera? Shouldn´t 2 perspective views suffice?

The idea for orthogonal views was based on the fact that from a single eye you don't get depth perception. Two eyes pointing in roughly the same direction (like ours) give you stereo vision such that you can discern depth.


If you get anything up and running for this effect, post some screenshots - I'm curious to see what it looks like [smile]

Cheers,
Jack

Share this post


Link to post
Share on other sites
Quote:
Original post by jollyjeffers
Quote:
Original post by matches81
I don´t see a reason for the orthogonal projection and the additional perspective camera? Shouldn´t 2 perspective views suffice?

The idea for orthogonal views was based on the fact that from a single eye you don't get depth perception. Two eyes pointing in roughly the same direction (like ours) give you stereo vision such that you can discern depth.


yeah, sure.... but we don´t have anything like stereo view on a screen anyway? The way a perspective view appears on a screen is the way it would look with only one eye anyways. So no point in using orthogonal projection, because even with one eye you would still get a perspective view, not an orthogonal one.

Share this post


Link to post
Share on other sites
The problem of wider field is that you have bigger picsels. This is not problem with computer screen, but in real animal life. Also you don't normally have 3d with computer. Also you have black spot in front of you if your eyes are in side. If images has done properly for wide angle camera, it is quite horrible to watch.

Share this post


Link to post
Share on other sites
Quote:
Original post by joltios
The problem of wider field is that you have bigger picsels. This is not problem with computer screen, but in real animal life. Also you don't normally have 3d with computer. Also you have black spot in front of you if your eyes are in side. If images has done properly for wide angle camera, it is quite horrible to watch.


I will leave the black spot away, I strife for realism and perfectionism... but I have to draw the line somewhere too, I don't think I will make some kind of effect that you can see your own nose if you are a human in my game (I got a quite big nose and I can see the tip of it when look in front of me). Yet when you are the lizard (with the eyes on the side), I will get some blurry effect in the middel of screen.

If I got something working, I will share it with this community. The faked view feature will be an triggerable option, you can switch back from 1e-person to 3th-person too and in 3th person you won't see the vision distortion effect anyway.

Thanks for all the input,

Thijs

Share this post


Link to post
Share on other sites
Quote:
Original post by matches81
but we don´t have anything like stereo view on a screen anyway?

We have! The nVidia GPU Programming Guide has a whole chaper about this.
They have a stereo driver, what you can find in the Drivers section. They recommend glasses like this: i-glasses, but you can use an ordinary red-blue glass too.

kp


Share this post


Link to post
Share on other sites
I made a quick study on the effect of tweaking the FOV parameter for the standard projection matrix. The following images all show exactly the same screen with different FOV angles.



Even with the 90 degrees fov the effect is noticable. When you look at the sails for example, these are parallel to eachother, but because of the wide angle the 'distorted' perspective is already there. With increasingly larger angles, this distortion becomes more and more prominent.

I don't know if this is the effect you are after, but the 164 degrees FOV gives a nice result without any extra code and only a small performance decrease. If you'd want accurately recreate the FOV for non-hunter animals, you'll probably have to use two camera's using the 164 degrees (or higher) FOV and render this on the left and right halves of the screen. From the 164 deg shot though, I'd say it's doable but probably quite queasiness inducing ;)

Share this post


Link to post
Share on other sites
Just a quick remark : the DirectX fovs are only HALF fovs. So when you wrote 45° on your screenshot, you were in fact using a 90° fov ^^

Share this post


Link to post
Share on other sites
Thanks for the remark! Finally them frustrum pictures in those books are starting to make sense :)

Well, then I guess you're done with using Math.PI/1.1 for your perspective matrix for the basic effect. There's still depth/perspective in the shot, but it is so distorted it could very well pass for the non-hunter FOV.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement