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"

[Closed] What is the pixel direction in a post process material?

Hello,

In a post process material, what would be the simplest way to construct the ray cast from the camera position and hitting the near plane at the current pixel coordinates? (in view space or in world space)

If I am correct, creating it requires knowing the horizontal and vertical FoV as well as the horizontal and vertical center offsets (for stereo rendering; anything else I missed?). Those might be exposed already but I haven't found them, and I'd prefer to double check before implementing something that was already there.

Product Version: Not Selected
Tags:
more ▼

asked Feb 24 '16 at 07:12 PM in Rendering

avatar image

Answers.Archive STAFF
1.9k 209 316 690

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

The question has been closed Feb 24 '16 at 07:12 PM by AndrewHurley for the following reason:

The question is answered, right answer was accepted


1 answer: sort voted first

I believe that Normalize(WorldPosition - CameraPositionWS) in the material should give you what you need.

If not, give me a shout and I will look more closely.

more ▼

answered Feb 24 '16 at 07:12 PM

avatar image

Answers.Archive STAFF
1.9k 209 316 690

avatar image Answers.Archive STAFF Feb 24 '16 at 07:12 PM

Oh I didn't realize both were available in post-process materials. Great! For some reason I had to invert UVLayoutToWorldSpacePosition, but other than that it worked. Thank you.

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

Follow this question

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

Answers to this question