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"

does anyone understand this bit of shader code?

Hi, I'm trying to reproduce this fake sphere effect, but I don't understand the code at all.

I think it's supposed to go into a custom hlsl node and then into world offset, maybe?

centerToEyeDist is probably the vector length of world position - camera position

I don't know what 'r' is. it probably stands for radius, but i'm not sure how to find that input.

alt text


Product Version: UE 4.22
budgetcutsphere.png (800.5 kB)
more ▼

asked Apr 15 '19 at 01:19 AM in Rendering

avatar image

1.4k 10 4 10

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

1 answer: sort voted first

The code is supposed to move a disc mesh in such way, that it separate visible and hidden parts of the sphere from given point of view. CenterToEyeDist is length of virtual sphere location in camera space. OffsetDist is the distance mesh would be offset from virtual sphere center towards view origin. offsetScale is distance mesh vertices would be pushed away from mesh center on a XY plane of camera space. r is radius of virtual sphere.

Basic implementation in material graph would look something like this: http://prntscr.com/ncp1fw

more ▼

answered Apr 16 '19 at 12:45 PM

avatar image

7.9k 130 31 293

(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