Forum Groups
  All forums
    Help & Feedback
      Questions
      Work in progress
      Finished Art
      Non-Max related
    Community
      Offtopic
      News
    Hardware
    Photography



Maxunderground news unavailable

Wire parameters - convert Point3 to Point4 for colors.
show user profile  Nanne
I'm trying to Wire Parameter the colour of a light to the colour of an Ambient Occlusion shader. How ever the light (Omni) uses Point3 variables [r,g,b] while the shaders uses Point4 [r,g,b,a]. I get the following message:

-- Unable to convert: [1,1,1] to type: Point4


Any idea on how to write an converter expression in the Wire Parameter dialogue. I would like it to work both ways, the connection that is.

Cheers!

Kristoffer Helander
www.kristofferhelander.se
  :: Works ::   |  :: Resumé ::   |  :: Contact ::   |  :: CG Blog ::   |  :: Links ::     
read 574 times
8/31/2012 5:45:41 PM (last edit: 8/31/2012 5:45:41 PM)
show user profile  Garp
For Point3 to Point4, you can use p4 = [p3.x, p3.y, p3.z, 0] (or whatever alpha value you want).
For the other way around, you could do the same (p3 = [p4.x, p4.y, p4.z]) or simply p3 = [1, 1, 1] * p4. Note that p4 * [1, 1, 1] doesn't work.

If you need 0-255 values in the point3 and normalized values in the point4 there's a more explicit way.




read 539 times
8/31/2012 6:50:19 PM (last edit: 8/31/2012 7:03:24 PM)
show user profile  Nanne
hmm, I was fooling around with .r, .g and .b but that didn't work. xyz worked like a charm :) Thanks! :)

Kristoffer Helander
www.kristofferhelander.se
  :: Works ::   |  :: Resumé ::   |  :: Contact ::   |  :: CG Blog ::   |  :: Links ::     
read 534 times
8/31/2012 7:02:51 PM (last edit: 8/31/2012 7:02:51 PM)
show user profile  Nanne
"If you need 0-255 values in the point3 and normalized values in the point4 there's a more explicit way."

I thought so, but no it seems to work as I expected with your first code :)

I'm using a Omni Light in Ambient Only mode with a Ambient Occlusion shader to simulate Global Illumination rather then using FG or GI. It's pretty cool :) Inspired by Jeremy Birn's methods in Maya at Pixar :)

Kristoffer Helander
www.kristofferhelander.se
  :: Works ::   |  :: Resumé ::   |  :: Contact ::   |  :: CG Blog ::   |  :: Links ::     
read 522 times
8/31/2012 7:16:42 PM (last edit: 8/31/2012 7:20:25 PM)
#Maxforums IRC
Open chat window


Support Maxforums.org