Renderbump

From The DarkMod Wiki
Revision as of 12:20, 4 August 2012 by Springheel (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

This tutorial explains how to use the built-in renderbump command in the Doom3 console (or in DoomEdit) to generate a normalmap for your low-poly models.

  • Create your mesh - make it as high-poly as you like
  • Create your low-poly mesh and try to meet the shape of the high-poly model as far as possible.
  • Create a U/V map for your low-poly mesh and take care that no face is sharing the same texture space.
  • Place your two meshes such that they are sharing the same 3D space - the high-poly model should "envelope" the low-poly one.
  • Hit "Apply Scale and Rotation" (CTRL+A)
  • Export your two meshes to ASE (using goofos ASE exporter script) to test.ase and test_hi.ase
    • Enable these options for the low-poly mesh: Face UV, Selection Only and UV Image as Material. Disable the other ones.
    • Disable all options when exporting your high-poly mesh: just tick the Selection Only option.
  • Create a shader definition containing the renderbump keyword:
textures/darkmod/test
{
	renderbump -size 1024 1024 -aa 2 -trace 0.5 -colorMap textures/darkmod/test_local.tga models/test_hi.ase
}
  • Change the material information (the *BITMAP one) for your low-poly mesh to point at this valid shader:
//base/textures/darkmod/test
  • Run DEdit or Doom3 and type this in the console:
renderbump models/test.ase
  • This will take some time (up to several ten minutes) and will create the textures/darkmod/test_local.tga.
  • Check your normalmap if it looks choppy or something. You might want to tune the -trace parameter or manually edit the normalmap.


A few other things that might be important:

The name for the texture in the hi and lo poly model must be different.

Remove the uvmap for the hipoly model?