[AssetStore] Normal & Specular Map Generator from Texture

Working on simple poor man’s normal map & specular map generator editor script.. (click image to view full size)
Left side = original bitmap, Right side = generated normal map + specular map

*Now Available from the Unity Asset Store: https://www.assetstore.unity3d.com/#!/content/10388?aid=1101lGti
Unity Forum Thread: http://forum.unity3d.com/threads/normal-map-maker.254310/

– Creates normal (bump) map from texture (works ok, with adjustable strength & optional blur filter)
– Basic Specular map calculation (on that main image specular map was handmade)
– If texture is not readable, set it automatically on for reading, then restore it to off
– User can cancel map generation (median filter can take a while on a big texture..)

– Editor GUI
– Progress bar with cancel button
– Optimize image processing (using setpixel now, setpixels would be faster) (For now only in median filter)
– Try using invoke? then it runs in background in editor(?) (not this time..)
– Documentation
– Specular map generator is not good quality..maybe in later versions can do better
– Set created normal map as [x] normal map.. (so that “fix now” button wouldnt appear)
– Texture leak warning.. (it was from median filter temporary texture, it wasnt cleared with DestroyImmediate)
– Request: Invert normal button (also invidual X, Y, Z flip)
– Request: Realtime preview (adding small texture previews first)
– Bugfix: AssetPostprocessor doesnt always run.. (Temporary fix, comment out line “if (!NormalMapMaker.running) return;”
– Feature: Add maximum texture size inside AssetPostProcessor



Shader used on that image:
– BumpedSpecular  With Separate Specular Map : http://answers.unity3d.com/questions/306921/add-specular-map-to-shader.html
– Added “#pragma exclude_renderers flash” to get rid off the shader warning..

Image credits:
Main image: CGTextures.com : http://www.cgtextures.com/texview.php?id=43972

Image#2: Ground ( http://www.cgtextures.com/texview.php?id=64716 )
unity3d_normal_map_bump_generator_ground_2<- Click to view

Image#3: Wood planks ( http://www.cgtextures.com/texview.php?id=36848 )
unity3d_normal_map_generator_plugin_wood1<- Click to view

Image#4: Plugin window

8 Comments + Add Comment

Leave a comment


Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.