Reply
Reply
 
Thread Tools Display Modes
Minato's Avatar
Old (#1)
May seem like an odd question,but how can i shift a sine wave left and right in the material editor?...
Offline , spline, 117 Posts, Join Date Apr 2012,  
   Reply With Quote

imbueFX's Avatar
Old (#2)
Just doing a simple add or subtract with a scalar value should be all you need (if I understand you correctly). What are you trying to achieve?
Offline , triangle, 251 Posts, Join Date Nov 2011, Location Denver, CO  
   Reply With Quote

Minato's Avatar
Old (#3)
Simply adding/Subtracting will shift the wave up/down and it's corresponding operation is (sinx)+1...i'm trying to achieve a shift in the X axis also known as a phase shift which corresponds to sin(x+1)...pure curiosity...^^
Offline , spline, 117 Posts, Join Date Apr 2012,  
   Reply With Quote

Money's Avatar
Old (#4)
I'm not sure you can get phase shift outside of 90 degree angle without using custom nodes. Adding or subtracting a scalar value wouldn't work because you would need to have those values change too during time to match the phase.

Anyway if you wan't to get 90,180,270 shift it's fairly easy. For 180 just use 1-x on sin, for 90 and -90 (270) you do the same just by using cos node. But for fine tuning like 15, 30, maybe by using custom node it would be possible, anyway I couldn't get it to work before with stock ones.

Actually, maybe even 45 angle should be possible with some simple math, this would be the formula in that case, but I would really need to test that on paper to make sure the numbers are correct

sin (x + 45) = (sin (x) + cos (x)) * sqrt (2) / 2

Last edited by Money; 06-20-2012 at 11:09 AM..
Offline , line, 96 Posts, Join Date Mar 2011,  
   Reply With Quote

Minato's Avatar
Old (#5)
Great info as always...i'm gonna try those out...thanks money...i had a feeling about using custom nodes...
Offline , spline, 117 Posts, Join Date Apr 2012,  
   Reply With Quote

imbueFX's Avatar
Old (#6)
Ah crap, I'm sorry I gave you an incomplete piece of advice. Add/minus against the time expression going in to your sine wave.

edit: I understand this is more of a hack than anything, and isn't really shifting the sine wave as it is more of an time offset, but it works and is cheap on instruction count.

Last edited by imbueFX; 06-20-2012 at 11:11 AM.. Reason: clowns
Offline , triangle, 251 Posts, Join Date Nov 2011, Location Denver, CO  
   Reply With Quote

Angry Beaver's Avatar
Old (#7)
Yeah I cracked open UDK because it didn't seem right there was no way to control it, by default the sine wave acts like it has a time node plugged into the right socket, but if you make an actual time node then like imbue says you can just add to it before you feed it in.
Offline , line, 84 Posts, Join Date Jul 2011, Location Canada  
   Reply With Quote

Money's Avatar
Old (#8)
That should work, for time node 2Pi is neutral value then right? So the desired angle would just be added as a scalar value in radians before that sine node.
Thanks imbueFX, it's been quite some time since I was messing with that, but I totally missed the part to try and control it before sine node.
Offline , line, 96 Posts, Join Date Mar 2011,  
   Reply With Quote

imbueFX's Avatar
Old (#9)
Np Money, I learned something new here as well. High five to teamwork!
Offline , triangle, 251 Posts, Join Date Nov 2011, Location Denver, CO  
   Reply With Quote

Minato's Avatar
Old (#10)
Very interesting,i never looked at it like that,seems right,thanks a lot imbuefx and money.
Offline , spline, 117 Posts, Join Date Apr 2012,  
   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Copyright 1998-2012 A. Risch