- uses surface fix extension package
version 1
Normal mapping using grids and surface fix. load a heightmap image. get it's color values. calculate the normal vector for each point in the heightmap. take the dot product of each normal vector in the normal map and the light direction vector using ds_grid_multiply and ds_grid_add_region. create light and dark pixels and draw them over a texture using surface fix. use a multiply blend mode when drawing the pixels over the texture: draw_set_blend_mode_ext(bm_dest_color,bm_zero).
normal mapping version 2
i used a colorized model instead of ds grids. much faster than looping and drawing each pixel.
bump mapping version 3
i draw a model to a surface using lighting. i use surface textures all over the place for floor and walls. there's 1 floor and 4 walls. 5 different faces. 5 heightmaps need to be drawn to get the bump mapping effect for each face. i define each face using 3 vectors. i use the 3 vectors to convert the light direction vector into a faces space. i draw a model to a surface using the calculated light direction vector. i draw the surface to the walls and floor. everything is wrapped up in some scripts for easy use! =)
Bump Mapping Host-A
bump mapping version 3

normal mapping version 1
Edited by slayer 64, 02 November 2010 - 01:00 AM.











