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"

AnswerHub Maintenance

Background maintenance is scheduled to occur between 9 - 11am EDT on Tuesday, May 21. Site operation may be slower than normal during this time and a brief interruption in operation may be observed

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

https://youtu.be/f786ak3GKQo?t=1633

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

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

avatar image

IndieGameCove
1k 6 4 10

(comments are locked)
10|2000 characters needed characters left

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

Deathrey
7.8k 130 30 292

(comments are locked)
10|2000 characters needed characters left
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