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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

How do I get a material to face the camera?

Hi there. I wanted to ask if there's any way to make a material to always face the camera. I'm trying to import a 3d model of a tree, and from a frontal point of view, everything looks fine, but when moving the camera, the leaves looks flat, as they consist of textures with an alpha channel mapped onto planes. You can see it in these pictures. alt text alt text

I'm trying to achieve the same effect as with "Billboards" (https://www.youtube.com/watch?v=hH-_-wPwkgw&list=PLdapDx3UrITd1yyxeRf8keUrlenkijp-X) but as a material instead of an actor blueprint, as I need it to react to material properties (roughness, normals, ...etc.) and I need it to be mapped onto the tree.

Does anyone know how to do it?

Advanced thanks!

Product Version: Not Selected
ue4treefront.jpg (84.5 kB)
ue4treeside.jpg (80.0 kB)
more ▼

asked May 03 '14 at 05:17 PM in Using UE4

avatar image

1 4 8 8

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

1 answer: sort voted first

This should be helpful:


Check the section titled : "Foliage Material"

more ▼

answered May 03 '14 at 06:44 PM

avatar image

3.4k 154 51 271

avatar image Wowthever May 04 '14 at 12:21 PM

Thanks for the info, it's exactly what I was looking for, but I've got a little problem when trying to apply it: how can I set up the Custom Expression node? Firstly I want to point out that I don't have any programming knowledges. I've copied that node structure and connected it directly to WorldPosition Offset, but I don't know how to set the HLSL code given in that link into the custom node. If I copy that code into the "Code" text input, it gives me the following error.

alt text

ue4codeproblem.jpg (213.1 kB)
avatar image Wowthever May 04 '14 at 12:44 PM

Solved,but even now, it's not perfect. xD When I rotate the object, it faces the camera but every face keeps their original orientation. That looks really weird applied to the leaves of the tree. Is there any way to make every face of the object to face to the camera, not only the object as itself? alt text

Really appreciated thanks!

avatar image mindfane May 04 '14 at 03:33 PM

Can you show me the output? ie the image of the tree from two different angles?

avatar image The Cheese Dragon Feb 26 '16 at 11:25 PM

I have this same problem, that node setup adds any rotation the object had in the scene to start with to the billboard rotation for some reason, not sure why. This is a problem for me since I'm using it for lods and want to be able to randomly rotate my foliage around the z axes to keep it looking un uniform when looking at more detailed lods but obviously I would still want the billboard lod to face the camera when I get to it!

(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