Search Feedback

20
votes

Provide camera rays in the Graphics.Blit Screen Quad

Graphics

-

-

Currently, it requires scripting to set up an image effect that calculates per pixel world positions, like explained in this video.
https://www.youtube.com/watch?v=OKoNp2RqE9A
You basically need to use GL to create a quad where the normals are vectors pointing to the corners of far-clipping plane.

Unity is internally doing the same when applying light in deferred rendering. It stores the camera rays in the normal channel of the quad and uses them, together with the depth value of the pixel, to calculate the world position. (UnityDeferredLibrary.cginc:152). If those rays would also be provided in the quad used by Blit(), it would be possible to implement world space effects into the render pipeline without scripting, which would allow to use them in command buffers.
This would give developers way more flexibility when implementing effects like the one in the video and would also make it way less "hacky".

Your opinion counts

Help us make things better. Share your great idea for improving Unity or vote for other people’s.

Log in to post a new idea

Categories

All

(9242)

2D

(233)

Ads

(42)

AI & Navigation

(70)

Analytics

(103)

Animation

(318)

Asset Store

(234)

Assets

(493)

Audio

(158)

Cloud Build

(98)

Collaborate

(33)

Docs & Tutorials

(202)

Editor

(2137)

Everyplay

(13)

Game Performance Reporting

(15)

General

(825)

Graphics

(783)

GUI

(371)

Input

(147)

Licensing

(76)

Networking

(163)

Physics

(346)

Platforms

(407)

Profiling & Optimization

(71)

Runtime

(164)

Scripting

(1030)

Terrain

(151)

WebGL

(132)