A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 23

Thread: Materials with Multiple Colors???

  1. #1
    Senior Member
    Join Date
    Apr 2002
    Posts
    153
    Can I create materials with multiple colors? What I want is a material that is a gradient from blue to bright green.

  2. #2
    FK's resident Kungfu Master
    Join Date
    May 2002
    Posts
    438
    i don't think it's possible to do that in Swift... however... i think u can do that in Flash...

  3. #3
    Senior Member RUSHVision's Avatar
    Join Date
    Dec 2000
    Location
    Pacific Northwest
    Posts
    5,441
    Sure you can do it in Swift3D. One thing you can do is to go to Setup>Materials and click on Add and you will have three different colors to work with...Diffuse, Ambient and Highlight. This may or may not get you the effect you are looking for.

    Another thing you can do is to make your object blue and then put a green light on it. Playing around with these two techniques should get you pretty close to what you want.

  4. #4
    FK's resident Kungfu Master
    Join Date
    May 2002
    Posts
    438
    i don't think the material tweaking will do any good... if u use green color for diffuse, u'll have green object and if u put blue as the ambient, you'll get green object with blue tint (the material will look like a mix of blue/green) and i think u can discount the highlight all together since it's more for light reflection effect and glossiness of the material...

    you might be able to have different material on different surface (only if it's text or an extrusion) but not mutiple colors on the same material like 1234 wanted...

    i've tried the lighting trick RUSH but i never get even color and the gradient is weird... im not sure wat kinda effect 1234 wants so i dunno if that trick will be sufficient or not...
    [Edited by phlegm_thrower on 08-03-2002 at 05:17 AM]

  5. #5
    Senior Member RUSHVision's Avatar
    Join Date
    Dec 2000
    Location
    Pacific Northwest
    Posts
    5,441
    So by playing around with the techniques I suggested I was able to come up with what is below. Is this anything like what you wanted?


  6. #6
    FK's resident Kungfu Master
    Join Date
    May 2002
    Posts
    438
    my bleeding pride aside i learn something new yet again today thanks Rush...

    this is the result i managed to get...



    no matter wat i tried the ambient color always come out stronger than the diffuse color... in this sample, i got rid of all the trackball lights and use 2 scene spotlights to illuminate the object otherwise the ambient color would simply dominate. i also couldn't get the green color to come out brighter coz if i add more lights, the green color will cover the whole plane.

    i tried to get the gradient to look as liner as i could but around the intersection of the plane u can sort of see the green color got weaker coz it's a round spotlight after all. i tried to add one more spotlight at 45 degree angle coz i thought that would cover it but instead the light defined the face of the plane enabling me to see them separated by a faint blue line. i could probably get around that by using more detailed mesh but then i thought it's not worth it.

    mind if i pick your brain a bit further Rush?? it's a lot easier to make radial gradient on a sphere but i would like to be able to create a more linear gradient effect on flat surface. any ideas?

  7. #7
    FK's resident Kungfu Master
    Join Date
    May 2002
    Posts
    438
    oh one more thing... wat if i wanna have gradient in an animation where i need to move objects, lights and camera?

    also if i want only ONE object to have it but with other objects bunch together, how should i do it without having the lights affecting them???

  8. #8
    Senior Member
    Join Date
    Apr 2002
    Posts
    153
    Thanks for all the responses. I'll give them a try.

    What I'm trying to do is create a panel that is blue on its main surfaces but with a blue-to-green gradient on its edges.

    I'll let you know if I get it working. Thanks again.

  9. #9
    Senior Member RUSHVision's Avatar
    Join Date
    Dec 2000
    Location
    Pacific Northwest
    Posts
    5,441
    1a2b3c4d ~
    Here is an example of a panel that might match your description.

    .

    phlegm_thrower ~
    Yes, it is pretty difficult to get this effect using just the different colors for the Material. It's a bit of a challenge to create the effect at all, actually. You are going in the right direction with using Spot Lights, but you might want to try adding a blue Point Light to keep the green from overwhelming the scene. I ended up adding a fair number of lights to get the effect I wanted. You are also correct in that adjust the mesh smoothness and quality will affect how the gradient is rendered. One of the biggest problems I had was getting a clean render even using the mesh gradient setting. It is difficult to get an even gradient. The area gradient setting would be my next choice, but it doesn't seem to pick up the color variations very accurately.

    As for rendering a scene where only one object has the gradient, you would probably want to render that object separately from the rest. Tough to do this kind of thing in an animated scene, though.

  10. #10
    FK's resident Kungfu Master
    Join Date
    May 2002
    Posts
    438
    Thanks Rush

  11. #11
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    Hmm, I did this with 4 targeted spots on each side, and two area lights, blue to the right, green to the left and used area gradient shading on render. The target lights were evenly space, and the area lights were in the center of the edge, but the gradient shades to the corners on render, which isn't what it looks like on edit. And how do you add a pic in a post?

    http://64.21.153.144/gradient.swf

  12. #12
    FK's resident Kungfu Master
    Join Date
    May 2002
    Posts
    438
    that looks nice but... if it's gonna look 2D like that, u can just do it in Flash straight away... guaranteed to be a LOT simpler (just draw a rectangle and fill 45 degree angle linear gradient )

  13. #13
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    Oh yeah, I know, I just wanted to see what I could do with the lights. I've only had this puppy since Thursday.

    I got some ideas though, on your blue/green brick, why not render it with the lines showing? That might offset the color more. But it's late, and I'll be dreaming this tonight, pondering RUSHVision's subtle reminder that this is all illusion and playing around with my new toy all day tomorrow. Never know what might happen.

  14. #14
    FK's resident Kungfu Master
    Join Date
    May 2002
    Posts
    438
    have fun with it... i dunno about u but im still having fun with it after all this time (couple of months?? )

  15. #15
    Senior Member
    Join Date
    Apr 2002
    Posts
    153
    Rush,

    Thanks for continuing to offer suggestions. I think I have not explained clearly what I'm trying to do.

    Below is the panel I am trying to create in Swift 3D; this static version of the panel was done in Flash.

    http://www.viswebsys.com/se/PanelAlone.swf

    Thanks again to Rush and everyone else for their suggestions.

  16. #16
    Senior Member RUSHVision's Avatar
    Join Date
    Dec 2000
    Location
    Pacific Northwest
    Posts
    5,441
    Originally posted by iaskwhy
    And how do you add a pic in a post?
    Check out this link:
    http://board.flashkit.com/board/index.php?action=bbcode

  17. #17
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    thanks Rush. Let's see if this works:

    Nope, don't work for swf. Anyway, here is a gradient fill revolving brick. It also shows the gradient in a static image. Pretty neat.

    http://64.21.153.144/blugrnbrik.swf

  18. #18
    Senior Member RUSHVision's Avatar
    Join Date
    Dec 2000
    Location
    Pacific Northwest
    Posts
    5,441
    iaskwhy ~

    You're close. Unfortunately, .SWFs have been disabled until certain security issues have been addressed. I have no idea when this will be, but until then we can only use static images in our posts. If you want to post a .SWF, then you need to upload it to your server and provide a link to it as you did originally.

    If you want to add an image, the only thing you would have to change is the extension on the file name as you have it, and upload a .JPG version of your .SWF to your server. Let me know if I haven't been clear enough in my explanation.

  19. #19
    Senior Member RUSHVision's Avatar
    Join Date
    Dec 2000
    Location
    Pacific Northwest
    Posts
    5,441
    That looks pretty good. Nice job

  20. #20
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    One more time.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center