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"

Dot Product Material Setup from basic nodes

Hi,

I'm learning Unreal 4 materials/shaders and have started trying to recreate some of the functions that Unreal packages up into a nice node by recreating them with the basic nodes, I'm attempting to try Dot Product as shown here on the Nvidia website;

http://http.developer.nvidia.com/Cg/dot.html

so the formula is as follows;

float dot(float4 a, float4 b) { return a.x*b.x + a.y*b.y + a.z*b.z + a.w*b.w; }

I've tried to recreate it in Unreal but my results are very different to the normal dot product result,

http://s23.postimg.org/4rtcx9fzv/Dot_Product_UE4.jpg

Any ideas or help is appreciated!

Thanks :)

Product Version: UE 4.7
Tags:
more ▼

asked Mar 25 '16 at 10:47 AM in Rendering

avatar image

kooltrader
1 2 2

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

1 answer: sort voted first

OK i did it!!!!!

I was appending the vectors rather than adding them!

http://s14.postimg.org/mmjn70ow1/Dot_Product_Final.jpg

more ▼

answered Mar 26 '16 at 10:10 AM

avatar image

kooltrader
1 2 2

(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