User Tag List

Page 1 of 4 1 2 3 ... LastLast
Results 1 to 10 of 34

Thread: 3D lighting shader (2D Normal Mapping) w. 3 lights

  1. #1
    Clickteam Clickteam
    Anders's Avatar
    Join Date
    Jun 2006
    Location
    Denmark, ┼rhus
    Posts
    3,457
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    3D lighting shader (2D Normal Mapping) w. 3 lights

    Normal Mapping pixel shader

    With this pixel shader you can apply 3D-like colored lighting to your sprites that you can update in real-time (up to 3 completely separate lights)

    To make the effect, you only need two versions of your image.
    • Your sprite
    • A normal map made from your sprite that covers your sprite
    To make a normal map of your sprite, you first need to make a "heightmap" of your sprite. It is a greyscale image where the lightness of the pixel determines how "close" to the viewer that point is. In my example the nose of "Alyx Vance" is the closest to the viwer (us) and is therefore very light.

    I then use a tool like either Photoshop using this plugin from Nvidia to convert the image from a heightmap to a normal map.
    If you use Gimp you can use this plugin.
    I'm quite sure there is some plugin for Paint.NET as well.


    What do you think?
    Attached files Attached files

  2. #2
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module
    Stephen's Avatar
    Join Date
    Aug 2008
    Location
    Montana
    Posts
    4,515
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: 3D lighting shader (2D Normal Mapping) w. 3 lights

    This is cool!

    stephen1980
    _____________________________________________
    Nivram's Examples -Need extensions? Send me a PM.-


  3. #3
    No Products Registered

    Join Date
    Mar 2007
    Location
    Sydney, Australia
    Posts
    1,369
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: 3D lighting shader (2D Normal Mapping) w. 3 lights

    Will check it out when I get home. Looks great though.

  4. #4
    No Products Registered

    Join Date
    Dec 2006
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: 3D lighting shader (2D Normal Mapping) w. 3 lights

    This is pretty rad. Will work awesomely on static things, but it would be a huge pain to generate normal maps for all the frames of anything animated. I may try implementing this in my new project.

  5. #5
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jun 2006
    Location
    Darlington, UK
    Posts
    3,298
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: 3D lighting shader (2D Normal Mapping) w. 3 lights

    I did this last year: http://www.clickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=108916#Post1089 16

    Well, except it was one light, not 3, and it was a directional light, not what looks like point lights.

    Good work

  6. #6
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleSWF Export Module

    Join Date
    Sep 2006
    Posts
    311
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: 3D lighting shader (2D Normal Mapping) w. 3 lights

    Very nice effect!
    But when i start the example, i get this:


    The picture is scaled somehow (in frame editor and at runtime).

  7. #7
    No Products Registered

    Join Date
    Mar 2007
    Location
    Sydney, Australia
    Posts
    1,369
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: 3D lighting shader (2D Normal Mapping) w. 3 lights

    Oh god, you killed her!!!

  8. #8
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module
    Stephen's Avatar
    Join Date
    Aug 2008
    Location
    Montana
    Posts
    4,515
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: 3D lighting shader (2D Normal Mapping) w. 3 lights

    Quote Originally Posted by bigredron
    Oh god, you killed her!!!
    LOL!

    stephen1980
    _____________________________________________
    Nivram's Examples -Need extensions? Send me a PM.-


  9. #9
    Clickteam Clickteam
    Anders's Avatar
    Join Date
    Jun 2006
    Location
    Denmark, ┼rhus
    Posts
    3,457
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    Re: 3D lighting shader (2D Normal Mapping) w. 3 lights

    Didn't know you already made one Dynasoft

    Quinto:
    You are the second person to experience this. Yves was a bit puzzled about it too. Maybe he can get a better idea what is going on if you post your graphic card details. Thanks

    About rotation:
    I will add a property that allows you to rotate the effect. If you use the MMF2 inbuilt angles it will also rotate the background behind the object.

  10. #10
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleSWF Export Module

    Join Date
    Sep 2006
    Posts
    311
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: 3D lighting shader (2D Normal Mapping) w. 3 lights

    Quote Originally Posted by bigredron
    Oh god, you killed her!!!
    Yeah, pixel saw massacre!!



    @Andos
    ATI Radeon X1900 XT 256 MB
    Catalyst version 08.1
    OpenGL version 6.14.10.7275
    Direct3D version 6.14.10.0555

Page 1 of 4 1 2 3 ... LastLast

Similar Threads

  1. Android Lights [Beta]
    By Stephen in forum Android Export Module Version 2.0
    Replies: 34
    Last Post: 8th October 2013, 09:26 AM
  2. Shader for lighting direction
    By Tuna in forum Hardware Accelerated Runtime
    Replies: 45
    Last Post: 19th September 2008, 01:03 AM
  3. turn on LED lights from mmf app?
    By Dave in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 22nd March 2008, 08:19 PM

Posting Permissions

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