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"

haven`t shader macros like Unity in Unreal?

Unity have shader macro like unity_ObjectToWorld.

Not in Unreal?

unity_ObjectToWorld is Scale, Rotation, Translation(Position) float4x4 Matrix

Do I need to always calculate the position, rotation, and size of an object in Unreal?

Product Version: UE 4.22
Tags:
more ▼

asked Jun 12 '19 at 09:51 PM in Rendering

avatar image

leehwanchoi
7 1 1 2

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

1 answer: sort voted first

Unreal material graph don't support matrixes, but there node which let you transform vector to different spaces which would be equivalent of mul(unity_ObjectToWorld, vector);. The name of node is "Transform" and in properties of note you select which space the input vector is and then what space vector should be outputted.

But you don't need to do this, as UE4 sends position and orientation to shader via parameters:

https://docs.unrealengine.com/en-US/Engine/Rendering/Materials/ExpressionReference/Vector/#objectorientation https://docs.unrealengine.com/en-US/Engine/Rendering/Materials/ExpressionReference/Vector/#objectpositionws

As you can see from that page there even more in disposal

There also "Object Scale" node which calculates scale

Also to me more exact "unity_ObjectToWorld" is not macro, it's a parameter send by Unity to shader and it a local to world conversion matrix, which is identical to actual model transform matrix which Unity send too as UNITY_MATRIX_M

more ▼

answered Jun 13 '19 at 12:43 AM

avatar image

Shadowriver
37.8k 937 172 1123

avatar image leehwanchoi Jun 13 '19 at 01:13 AM

thank you Shadowriver! I got a lot of help.

(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