Jump to content
The Dark Mod Forums

How To Use Renderbump?


SneaksieDave

Recommended Posts

Anyone know anything troubleshoot-specific for renderbump? I can seem to get renderbumpflat to work just fine, it generates what seems to be a mask in one file, and a nice flat normalmap in the other. However, renderbump consistently gives me results like this:

 

renderbump \models\darkmod\props\containers\crate03.lwo

----- Renderbump \models\darkmod\props\containers\crate03.lwo -----
surface 0, shader tdm_crate02
renderBump =  (no action)
0.39 seconds for renderBump
---------- RenderBump Completed ----------

 

It looks like it aborts before anything even starts. There are no images dumped anywhere. I've tried it with a bunch of different LWOs, the one above being a simple crate. These are the untouched TDM-ready versions, so I assume they're all set up with whatever texture coord info it needs.

 

http://www.iddevnet.com/doom3/bumpmaps.php

Link to comment
Share on other sites

I recommend using ORB (http://engineering.soclab.bth.se/tools/177.aspx) rather than Doom 3's renderbump. It is more interactive and does not require setting up MTR files to define the parameters.

 

Otherwise, you have to have a renderbump global keyword in your low-poly model's material definition, giving the renderbump parameters and the path to the high-poly version.

Link to comment
Share on other sites

You do realise you need a low and high res version of the object to use renderbump? It's not for making a normal map from the crate texture, it's for making a normal map from the geomerty of the high res crate.

Civillisation will not attain perfection until the last stone, from the last church, falls on the last priest.

- Emil Zola

 

character models site

Link to comment
Share on other sites

Right, I was trying/assuming to use the existing model to spit out a normalmap and have a look at it. It worked for renderbumpflat, so I assumed renderbump worked the same, just for objects instead of flat surfaces.

 

Okay, so the high is needed, hrm. Well perhaps I can do it with some test model I make.

Link to comment
Share on other sites

I don't want to make new thread, so I'm writing here.

 

Does the trace parameter work for anybody? Sometimes I get holes and increasing it should theoretically help but the normal map I get after increasing the trace factor is completely messed...

Link to comment
Share on other sites

I tried ORB, but for whatever reason, it crashes when even trying to open one of my Blender-exported ASEs. It can open the ASE from 3DS which comes with the package (of course), but not mine.

 

So I'm giving Doom3 another try. Could any of you give me a sample material (or heck, even a low and high model and material) that I can look at and emulate? So far it's not working, and I don't really have any idea what I'm doing wrong - no example on modwiki, no example on iddevnet.

 

 

Edit: I'm just not getting this.

From id's mapobjects.mtr, the only type of hints I can find:

	renderbump  -size 512 512 -trace 0.1 -aa 2 
models/mapobjects/hell/torches/torso_local.tga 
models/mapobjects/hell/torches/torso_hi.lwo

I emulate that with my assets, even though it makes no sense to me, and it of course doesn't work. Why is there a *_local line in there at all? I'm trying to generate the normalmap; why would I include a normalmap in the material definition? What the hell? Time wasted++.

Link to comment
Share on other sites

The local map is the file that is generated when you run the renderbump command in Doom 3.

 

The basic workflow is to export your low-poly model as normal, create a material from it in the usual way but add a renderbump line similar to the above which details the size, the path to the hi-poly model and the destination normalmap. Then when you call renderbump on your low-poly model in the console, it will pick up this information, load the high poly model and generate the normalmap.

Link to comment
Share on other sites

But that's just it - it doesn't do that. Or rather, it hasn't:

 

- I used the working dice from in game (so that I know it's set up correctly)

- I used the original .blend file, subdivided a couple of times and smoothed, to make a higher poly version, and then exported it the same way, alongside the original dice.ase

- within the material I added:

 

renderbump  -size 512 512 -trace 0.1 -aa 0
models/darkmod/props/textures/dice_local.tga 
models/darkmod/props/misc/dice_high.ase

 

To which Doom3 answers:

 

renderbump /models/darkmod/props/misc/dice.ase
----- Renderbump /models/darkmod/props/misc/dice.ase -----
WARNING: unknown general material parameter 'models/darkmod/props/textures/dice_local.tga' in 'dice'
surface 0, shader dice
renderBump =  (no action)
0.04 seconds for renderBump
---------- RenderBump Completed ----------

 

And there's nothing, no output (as evidenced by the time as well). Even substituting my existing low detail normalmap doesn't do anything, so it's not clear if that instruction is for input, output, or something else altogether. Since we've had this done before (for characters at least), how was it set up?

Link to comment
Share on other sites

That renderbump expression needs to be on a single line. It looks like you have split it over three lines which is causing the material parser to complain.

W00T! That was it! :) Now to the next step.

]renderbump models/darkmod/props/misc/dice.ase
----- Renderbump models/darkmod/props/misc/dice.ase -----
surface 0, shader dice
renderBump = - size 512 512 - trace 0.1 - aa 0 models/darkmod/props/textures/dice_local.tga models/darkmod/props/misc/dice_high.ase (rendering)
loading models/darkmod/props/misc/dice_high.ase...
12 triangles made 120000 links
trace fraction 0.10 =   0.15 model units
writing models/darkmod/props/textures/dice_local.tga (512,512)
8.08 seconds for renderBump
---------- RenderBump Completed ----------

However, the normalmap is blank grey. Hmmmm... I might have an idea or two as to why.

 

Edit: I assumed I must include a material in the high poly model (no effect).

 

Edit: I'm assuming the UV mapping has to match, for D3 to make something from the high which the low can use. But how can it? The seams won't be the same between a low poly and high poly model.

 

Edit: Using a simple cube made this task easy, however it didn't help.

Link to comment
Share on other sites

Okay, I got it working with ORB. For whatever reason (probably depends on paths and materials more than I expected) it crashes loading local copies of the files, but seems to work with the darkmod-foldered items. Anyway, I generated a 2k poly normalmap in a few mins - which definitely tells me D3 isn't working, since it's done in 8 seconds, giving me a grey TGA.

 

This leaves me with two lingering questions.

 

1. Why doesn't it work in D3 with renderbump? Is it just much more sensitive to everything being set up in one exact way, and ORB is that much more forgiving? What little facet am I missing?

 

2. I'm assuming UV maps must agree between low and high poly versions (how else could it work?) How on earth is this achieved? I did it with a simple cube as proof of concept, but most game models aren't cubes. High poly versions will be much harder (and I'd imagine sometimes impossible) to reproduce the low poly UV map exactly. Is there a way to export or transfer the low poly UV map into the high poly model for export and use? Or is that the wrong approach completely? Could it be that (dare I dream) these things take the high UV map, and map it onto the low UV map shape for the output image?

 

Learning a lot in the past week. Head hurts.

Link to comment
Share on other sites

You don't need UVW map for high poly model. It has to be just mesh - nothing more. Low poly model should be UVW mapped.

 

8 sec. for 512x512 map for simple cube with D3 is possible. It's fast normal map maker cause it's hardware supported. F.e. my recent models - cutlery - have around 150 faces for low poly and about 20-30k for hi-poly and it takes only 18-19 sec. to complete normal map.

 

Are you sure that your low and hi poly models are at exactly same positions (overlapping each other)? If not - then maybe that's why you get blank normal map...? Just guessing...

Link to comment
Share on other sites

You don't need UVW map for high poly model.

Whew, that is great news. I was dreading even thinking about having to UV map everything twice, AND making them match. I guess it must use the low poly UV map for the coords?

 

Are you sure that your low and hi poly models are at exactly same positions (overlapping each other)?

Yep, in fact here's how I made my little test case, for simplicity. I took my simple cube for the dice and exported it, ready for in game use. Then, I took the same file and added a bevel, subdivided a few times, and then smoothed a bunch. Didn't change anything else, and exported as dice_high.ase. So they must coincide.

 

I'll try a new test with no high_poly UV map, but I still can't figure why D3 is giving me a blank. If it's useful info, the dice_d.tga file (presumably diffuse) that ORB is spitting out is the same as the D3 normalmap - a grey field. Could it be that Doom3 is being instructed to export the wrong map?

 

I could give the high poly file, if anyone wants to try that with the material and low poly which are already on CVS (except for the extra instructions pasted above).

 

 

Edit: Yay, it just worked in D3, too. I don't know why, the only thing I changed was generate a brand new high poly model and not provide a UV map at all. Maybe that was causing a problem somehow? Either way, success!! Thanks for the help guys.

Link to comment
Share on other sites

Whew, that is great news. I was dreading even thinking about having to UV map everything twice, AND making them match. I guess it must use the low poly UV map for the coords?

 

Yes, it uses the low-poly UV map to identify a coordinate on the normalmap image, and then uses the high-poly mesh to calculate what the normal should be at that point.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • nbohr1more

      The FAQ wiki is almost a proper FAQ now. Probably need to spin-off a bunch of the "remedies" for playing older TDM versions into their own article.
      · 1 reply
    • nbohr1more

      Was checking out old translation packs and decided to fire up TDM 1.07. Rightful Property with sub-20 FPS areas yay! ( same areas run at 180FPS with cranked eye candy on 2.12 )
      · 3 replies
    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 7 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
×
×
  • Create New...