Reply
Reply
 
Thread Tools Display Modes
Ace-Angel's Avatar
Old (#1)
Hey to all,

I was wondering if anyone knew a good way to substitute certain function or math for application that don't have certain functions available?

For example, I'm trying for a Atmospheric Scattering material in UDK, but there are snippets of code which don't work in UDK, like this for example:

Quote:
float fFar = length( v3Vector );
Currently, UDK doesn't allow me to access the Length function, so I approximated it by using the 'Distance' function instead, but that doesn't seem right since my current output looks like a glow ball of fire.

This happens both for Planet and Sky based Atom-Scatter.

Incase you need to checkup the codes I'm referencing, here they are;
http://www.gamedev.net/topic/621187-...ic-scattering/
http://forums.create.msdn.com/forums/p/9117/454655.aspx
http://stainlessbeer.weebly.com/plan...cattering.html
http://forum.unity3d.com/threads/122...cattering-help

Cheers!
There's a very good chance that I experienced MORE problems, then all the internet put together in the area of 3D. Talk about being original for once...
Offline , veteran polycounter, 4,575 Posts, Join Date Apr 2011, Location Canada  
   Reply With Quote

haiddasalami's Avatar
Old (#2)
Hey Ace, if I remember right distance node comes in Unreal Units so you need to scale it.
WebGL Project - In a state of constant flux so might be down when you check it. Pretty old now.
Junior Technical Artist at Digital Extremes.
Offline , dedicated polycounter, 1,881 Posts, Join Date Nov 2009, Location Toronto  
   Reply With Quote

Ace-Angel's Avatar
Old (#3)
Hey Haid,

That's a start, but any ideas on how I would go about doing that? I'm not sure how or what UDK's values vs. others is, google is coming up empty. I'm guessing it's scaled to Max?
There's a very good chance that I experienced MORE problems, then all the internet put together in the area of 3D. Talk about being original for once...
Offline , veteran polycounter, 4,575 Posts, Join Date Apr 2011, Location Canada  
   Reply With Quote

ambershee's Avatar
Old (#4)
UDK has one UU = 1cm by default (this is documented). As for other applications and this shader, I couldn't say.
+++MESSAGE ENDS+++
Offline , dedicated polycounter, 1,633 Posts, Join Date Nov 2005, Location Newcastle, UK  
   Reply With Quote

cptSwing's Avatar
Old (#5)
i thought 1 UU = 2cm?
Offline , dedicated polycounter, 1,328 Posts, Join Date Aug 2011, Location Berlin  
   Reply With Quote

haiddasalami's Avatar
Old (#6)
Hey Ace sorry cant be of much further help, maybe try making the length formula back up for the vector? so:

sqrt(x^2, y^2, z^2)
WebGL Project - In a state of constant flux so might be down when you check it. Pretty old now.
Junior Technical Artist at Digital Extremes.
Offline , dedicated polycounter, 1,881 Posts, Join Date Nov 2009, Location Toronto  
   Reply With Quote

Brice Vandemoortele's Avatar
Old (#7)
or: sqrt(dot(v,v))
Offline , triangle, 309 Posts, Join Date Jan 2005, Location Belgium Send a message via Skype™ to Brice Vandemoortele  
   Reply With Quote

ambershee's Avatar
Old (#8)
Quote:
Originally Posted by cptSwing View Post
i thought 1 UU = 2cm?
In Unreal Tournament games it is. In Gears of War it is 1UU to 1/2 inch.
+++MESSAGE ENDS+++
Offline , dedicated polycounter, 1,633 Posts, Join Date Nov 2005, Location Newcastle, UK  
   Reply With Quote

Froyok's Avatar
Old (#9)
Quote:
Originally Posted by cptSwing View Post
i thought 1 UU = 2cm?
That's the case but :
Quote:
UE3 treats one Max Unit as one Unreal Unit, regardless of what length the units were originally set to in Max.
Same case from Maya.


The Units are also dependent of the game you use because they are specified in the script files. Gears of war use character much taller than in Unreal Tournament.
The "mobile" gametype in UDK use a player size larger than in the UT DeathMatch gametype for example.
Offline , polycounter, 803 Posts, Join Date Jun 2010, Location Namur, Belgium Send a message via MSN to Froyok Send a message via Skype™ to Froyok  
   Reply With Quote

Ace-Angel's Avatar
Old (#10)
Sooo...based upon all this information, at least on a shader level, I'm pretty much plugged in my dark hole (aka fucked?).
There's a very good chance that I experienced MORE problems, then all the internet put together in the area of 3D. Talk about being original for once...
Offline , veteran polycounter, 4,575 Posts, Join Date Apr 2011, Location Canada  
   Reply With Quote

almighty_gir's Avatar
Old (#11)
Quote:
Originally Posted by ambershee View Post
In Unreal Tournament games it is. In Gears of War it is 1UU to 1/2 inch.
1/2 inch != 1cm

1/2 inch = 1cm * 2.54 * 0.5 = 1.27

1UU in GoW = 1.27cm
Offline , veteran polycounter, 4,407 Posts, Join Date Nov 2004,  
   Reply With Quote

cptSwing's Avatar
Old (#12)
yeah, i've switched to max's generic units as well.. after having used cm's in max and doing the 'math' in my head, which in retrospect is a little convoluted ;)
Offline , dedicated polycounter, 1,328 Posts, Join Date Aug 2011, Location Berlin  
   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