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"

Need help parsing planar data & AbsoluteWorldPosition in Material Editor

In my project, I'm trying to design a material that will only display when viewed through a particular window frame (almost like a portal effect). To do this, I am dynamically calculating a custom view frustum based off of the player's camera position and empty actors placed at the corners of the window frame to define the edges. I want to use opacity masking to set the material up so that, at each pixel, if it is within the bounds I have set (on the correct side of each of the four planes), then it will draw; if not, it will be masked.

Please note that, due to technical limitations in the project, I cannot use Render Textures or any Post Processing effect (like Custom Render Depth) to achieve similar results.

I am calculating the planes in the level blueprint like so: alt text

Then, I am passing that information to the material using a global Material Parameter Collection, and setting up the opacity mask like this: alt text

However, the material is not behaving correctly, and is giving me anomalous results that I can't quite understand. I've tried splitting up the planes individually to observe their behavior, and each seems to be failing in a different, inconsistent manner. Using various debugging tests, I can confirm that the planes are calculating correctly for exactly what I want, so I know that my math checks out (the result of the dot product should be positive if it's on the side of the plane that I want, and negative if it's on the other side). I'm starting to suspect that the data somehow isn't getting parsed properly when it gets passed to the material, but I'm frankly not familiar enough with the Material Editor to understand what's happening.

Can anyone help me understand how to make this work properly, or spot anything I'm missing? Any help you can provide would be greatly appreciated. Thanks!

Product Version: UE 4.14
1.png (817.2 kB)
2.png (731.7 kB)
more ▼

asked Jan 26 '17 at 04:26 PM in Blueprint Scripting

avatar image

118 10 16 22

avatar image Matt_GrooveJones Jan 27 '17 at 03:59 PM

Anyone have any ideas? I'm still looking for help on this.

avatar image Matt_GrooveJones Jan 27 '17 at 04:26 PM

Does the answer here (https://www.reddit.com/r/unrealengine/comments/5ig0r8/adding_vectors_to_material_parameter_collections/) have any bearing on the problem I'm seeing? What would that fix look like in my material? What he's suggesting is just a little over my head when it comes to the Material Editor, so I'm not certain if it's applicable, or how to enact it if it is.

avatar image Matt_GrooveJones Jan 27 '17 at 05:58 PM

Minor success - setting up the planes this way (image) at least displays the planes properly, but now I seem unable to determine which side of the plane the rendered point is on (that is, it hides all of the pixels which lie exactly on the plane, but draws all pixels that are both above and below it). Both sides are giving the same dot product result of 1. Thoughts? alt text

3.png (398.5 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

I finally found the answer. In case anyone else needs this in the future, here is the solution:

alt text

4.png (702.0 kB)
more ▼

answered Jan 27 '17 at 08:41 PM

avatar image

118 10 16 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