“Bump” light from spotlight source

30.12.2007 Anton Volkov

Despite all the russian holidays and clear Karpovich’s directive to forget about job and have some rest, I couldn’t let go an idea to make fast “bump light” not only from directional light source, but from spotlight too. This is relatively hard because light goes in all directions, so it seems that you’ll have to count lighting for every pixel… or not? I came up with an idea to modify normals map, to kinda “bulge” it in spotlight coordinates. Main issue is that it is not so hard to count it pixel by pixel, but it is slo-o-ow process. So I was forced to cast a spell find a way to modify normals map using standart Flash filters and blending modes.

We will use that in engine for sure, because our bet is do-it-once counting phases with further maps “baking”. When Hydra will come out with new Flash 10 we’ll just have to pass this routine to shaders.

Рельефное освещение от точечного источника
Size: 1.6Mb

Controls:

  • Mouse move — move light source
  • Mouse click — change light color
  • Mouse wheel or +/- — change material’s highlight curve
  • Ctrl + wheel or +/- — change spotlight size
  • Spacebar — nex tex

I hope now I can finally turn loose now :) Happy New Year and Merry Christmas!

6 Responses to ““Bump” light from spotlight source”

  1. CornFlex - Flex & Flash by Quentin Lengelé » Blog Archive » PV3D BumpMapping Says:

    […] Source : http://blog.alternativaplatform.com/en/2007/12/30/spot-normal-mapping/ […]

  2. AS3 Flash 3D Engine Alternativa Platform Drops A Nuke - Isometric and FPS « [ draw.logic ] Says:

    […] bump lighting; […]

  3. [”Le String dans l’Array”] » Archive du blog » Alternativa3D 5.0 Says:

    […] avoir lancé une série de démos AS3 impressionantes ( bump mapping, Parallax effect, Normal map lighting..Etc), les russes d’Alternativa Platform ont publié […]

  4. Alternativa3D, nuevo motor 3D para Flash. - ExeBlog, desarrollo de videojuegos y más Says:

    […] bump lighting […]

  5. tedi Says:

    good job!

  6. Selkcip Says:

    I know that this post is, er, somewhat old, but I wanted to thank you. I was doing some flash programming and was messing around with normal maps to use with the displacementmap filter. I then thought that I’d use them for normal mapping, assuming that it would be a simple matter of multiplying the channels. Of course, I was horribly wrong. So I searched for help, and found this…which amazed me. i couldn’t figure out how you did this without using a per-pixel system. I tried in vain to make something like it. Then decided that I’d try and make a per-pixel normal map renderer. I managed to get that working. i kept coming back to this example in hopes that I could figure it out. I did or at least a rough approximation. So I’m saying thatk you for inspiring me to keep trying with the knowledge that it clearly possible.

Leave a Reply

Powered by WP Hashcash