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"

Make an Actor always behind others

I'm currently making some space environment - to use something more creative than skybox I made Earth and stars as other actors. Because of technical issues I can't make them further than ~20-30.000 units (...300 meters? Great cosmic space, dude), but I solved problem of parallax scrolling with translating sky with the player.

alt text

Now this solution turns against me - when I build something larger than 300 meters, like landscape, all illusion falls:

alt text

I can't spawn Earth and stars further than now. So I thought - can we set them to other layer to be always behind other objects? Even when Earth has 10 cm of diameter and is technically 10 cm over our heads?

Ah - if possible, tell me also how to set a layer from level of C++.

Product Version: UE 4.12
Tags:
par1.png (210.3 kB)
more ▼

asked Aug 12 '16 at 01:53 PM in Using UE4

avatar image

mortmaire
137 12 10 22

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

1 answer: sort voted first

I found it! In short, you need to set the value of Pixel Depth Offset in Material settings to some sick large value. I'm not sure of form of this variable - is it Vector3? Vector4? but with method of trying and failing I found that making vector of form (1e9,0,0) works:

alt text

Second case is subtle - even if your material will have offset to behind all items, it will still cast shadows - so we will have some 'ghost' of our object in place of it's real position, even if object itself is visible far behind scene. The solution to this problem is simple - I just used method SetCastShadow of MeshComponent with given argument false. The shadow was still on Earth, but Earth itself wasn't giving shadow any more.

pix.png (385.1 kB)
more ▼

answered Aug 14 '16 at 10:58 AM

avatar image

mortmaire
137 12 10 22

(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