• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Simulating "Bump mapping"

Status
Not open for further replies.
Since Warcraft 3 came out before bump mapping was a thing, .mdx format accepts only flat textures. However, I'm looking at a way to circumvent this by creating a new texture that combines the diffuse map texture with the bump shading provided by the normal texture. But I don't know which tool lets me do this. Does anyone have an idea or know a tool that can accomplish this?
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
That is literally not possible.
If you want the normal map to have any meaning, you need to have light information.
Having encoded normals gives you nothing in this context.

Actually you can probably do this sort of stuff in 3ds Max, given that you have the model, but it will essentially be the same as below - generating a light map and multiplying it with the diffuse (also known as baking).

Instead, what you can do is generate a light map, given some constant light, which would result in a black and white gradient, which you can then multiply with the diffuse map in any 2D authoring program (Photoshop, GIMP, etc.)
I don't think it will look good in WC3, but you can try.

Now, if you want something that you can give light information and it will spit said light map, without requiring the model, I don't think anything like that exists.
It's very simple to make, but I don't think anyone has any reasons to do this sort of thing.
Essentially you need to define a directional light (or multiple ones), and then just do the usual dot product between the per-pixel normals and the light direction.
You can probably write something for this in JavaScript in about 10 minutes (if you are interested, I might do it).
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Whoops, made the tool in a web page, then I remembered that normal maps are generally encoded in tangent space, which makes them useless without spatial data (vertex positions).

So yeah, it's actually a useless demo, unless you have a world space normal map (if it's the usual blue-ish map, it's in tangent space), but if you want it either way, I attached the html file that you can open locally.
To use it, drag and drop your diffuse and normal maps to the left and center images, the result is shown to the right.
You can play with the light direction which will change the result.
 

Attachments

  • MultiplyNormals.zip
    364.7 KB · Views: 48
Level 29
Joined
Jul 29, 2007
Messages
5,174
The model. For any kind of per-pixel shading, you need per-pixel normals. You always need the model to get per-pixel normals, unless you have a world space normal map, which you will likely never have (no games that I know of use them, because tangent space can be compressed far better).
 
Status
Not open for further replies.
Top