Jump to content

Rendering Only A Portion of the Scene


photo

Recommended Posts

Hey Everyone,

I have a camera having let's say 120 degrees horizontal fov, using this camera I am able render a scene whose resolution is 1000 x 1000. (Hence Vertical FOV is also 120 degrees.)

But I want to render only 500 x 500 portion of the image relative to the center. How to achieve this without changing the field of view of the camera?

Of course I can crop the image after rendering to get the desired result but this is not efficient. I don't want engine to render whole 1000 x 1000 image.

Thanks.

SC.jpg

Edited by tariqalmasri
Typo
Link to comment

Dear @tariqalmasri,

I do not see any connection between your requirement and FOV. The frustum you want is full (left, right, top, bottom);

Then the rendered thing you need only center half screen. But changing FOV will change everything for you.

It seems that your requirement just need a simple post material which will do the task for you. I don't see any possibility of changing FOV to match your requirement.

Rohit

Link to comment
3 hours ago, rohit.gonsalves said:

Dear @tariqalmasri,

I do not see any connection between your requirement and FOV. The frustum you want is full (left, right, top, bottom);

Then the rendered thing you need only center half screen. But changing FOV will change everything for you.

It seems that your requirement just need a simple post material which will do the task for you. I don't see any possibility of changing FOV to match your requirement.

Rohit

I don't think so. There is of course a relation between FOV and crop factor. 

 https://en.wikipedia.org/wiki/Crop_factor

Link to comment

Dear @tariqalmasri,

Crop factor is very different thing. Please don't get confuse with it? Crop factor is 35mm equivalent.

Are you doing that? I think no.

Then Either I didn't understand your problem or what have suggested by Silent is a good optimization for your problem. By keeping FOV for full render and then skipping part which are not required is good approach with post.

All the best.

Rohit.

Link to comment

Dear @rohit.gonsalves,

30.png is taken from a camera whose fov is 30 degrees.

60.png is taken from a camera whose fov is 60 degrees.

60 cropped.png is the cropped image from 60.png.

What is the difference between 30.png and 60 cropped.png ignoring the dof effect?

I still don't get it.

 

Thank you for your response.

30.png

-> 30.png

 

 

 

 

60 cropped.png

-> 60 cropped.png

 

 

 

 

60.png

-> 60.png

 

Edited by tariqalmasri
Link to comment

Dear @tariqalmasri,

Quote

What is the difference between 30.png and 60 cropped.png ignoring the DoF effect?

30.png is 3D projection of 30 degrees FOV onto your viewport. and 60 cropped is 2D magnification of cropped part of image taken with 60 degrees FOV. So difference is how you achieved the result. Also The blur is not DoF (Depth of Field is optical stuff) but filtering blur after you use magnification filter on smaller image.

I am totally lost from the first question to this discussion. What do you want to achieve with your first question?

Quote

I still don't get it.

Basically, 30 Deg FOV and 60 Deg FOV cropped image will give you similar effect if you understand the mathematical model of FoV.

For you reference. One of the wonderful web link to understand Projections.

3d-viewing-pinhole-camera

The Perspective and Orthographic Projection Matrix

Also. Try to understand UNIGINE projection matrix formulation from API frustum. You will make it out all differences I trust.

https://developer.unigine.com/en/docs/2.12/api/library/math/math.matrix?rlang=cpp#frustum_float_float_float_float_float_float

UNIGINE also has methods for classic Vertical FOV and physically based FOV. (Where you can use cropped factor sensor sizes as film gates)

Rohit

Link to comment
×
×
  • Create New...