x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Modifying the camera for custom DOF

I'm looking at creating a camera whose depth of field properties would be calculated from real life lens parameters (focal length, aperture, subject distance).

I'm thinking about having those parameters drive Focal Distance and Focal Region, so that I'm not changing the fundamentals of the camera system.

Assuming I can do this (can I ?), would I be able to see the changes live in the editor?

Product Version: Not Selected
Tags:
more ▼

asked Mar 11 '14 at 04:45 AM in Everything Else

avatar image

ue4-archive ♦♦ STAFF
50k 3670 1999 9124

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Hi Cedric,

Yes, you should be able to drive those parameters and see them live in PIE and (depending on how you drive them) in the camera preview inset box in the editor viewports.

On the camera component, the property PostProcessSettings controls what overrides are being applied, and what those overrides are. Set bOverride_DepthOfFieldFocalDistance and bOverride_DepthOfFieldFocalRegion to true and modify DepthOfFieldFocalDistance/DepthOfFieldFocalRegion to whatever values you calculate from your exposed parameters (in e.g., PostEditChangeProperty for the actor class containing your camera component).

Cheers, Michael Noland

more ▼

answered Mar 11 '14 at 04:45 AM

avatar image

ue4-archive ♦♦ STAFF
50k 3670 1999 9124

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 04:45 AM

Hi Michael,

This doesn't seem to work in Beta 5.

When creating my camera component, I do the following:

 CameraComponent->PostProcessSettings.bOverride_DepthOfFieldFocalDistance = true;
 CameraComponent->PostProcessSettings.bOverride_DepthOfFieldFocalRegion = true;
 CameraComponent->PostProcessSettings.bOverride_DepthOfFieldScale = true;
 CameraComponent->PostProcessSettings.bOverride_DepthOfFieldMethod = true;
 CameraComponent->PostProcessSettings.DepthOfFieldMethod = EDepthOfFieldMethod::DOFM_BokehDOF;
 CameraComponent->PostProcessSettings.DepthOfFieldScale = 1.0f;

Then I change DepthOfFieldFocalDistance and DepthOfFieldFocalRegion when required, but I don't see any result. I can confirm that the post process settings values are actually being modified, but I don't see any Depth of Field change in the camera preview window.

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 04:45 AM

Hi Cedric,

Have you set PostProcessBlendWeight to a non-zero value? If so, is it failing to take effect only in the preview viewport, or everywhere?

Cheers, Michael Noland

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 04:45 AM

Ha thanks, I missed that property. It's failing in the preview viewport, but works in game.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question