Jump to content
The Dark Mod Forums

Recommended Posts

Posted

Do you know if it's possible to have 2 normal maps per surface (material) ?

For example, I want to have a large rock with one normal map defining general shape details (non-tiling, fits the model) and second normal map defining smaller details, tiling over the surface.

I recall there was something like adding normal maps or adding normal and heightmap in Doom 3, but I am not sure how (if possible at all) to make one texture just fit the model as if it was just a regular func_static with regular material, and have "detail" normal map being added to the original one, but having it tiling, as if it was like a wall textures.

 

Thanks.

Posted

Yes, except those have to occupy the same UV space.

 

Imagine a model. Bake out normal map for it that represents major detail on the model. The image is 2048 x 2048. Then take a "detail" normal map, tileable, 512 x 512 size. If you do addnormals with those two, the first one will fit fine, but the second one will be stretch to fit UV space. I need for second one to be tiled over UV space and I should be able to set tiling parameters.

Posted

Image Program Functions

These can be used anywhere that accepts <map> and can be nested

 

addnormals(<map>, <map>)

 

Adds two normal maps together. Result is normalized.

Hmm interesting, can you give a full example so I/others can see where to insert the extra details in the material def.

bhm_banner.jpg

Posted
Hmm interesting, can you give a full example so I/others can see where to insert the extra details in the material def.

 

 

I've been told we shouldn't be using addnormals because if/when we get normalmap compression it won't be compatible.

Posted

 

I've been told we shouldn't be using addnormals because if/when we get normalmap compression it won't be compatible.

 

Doom 3 BFG uses compression for normal maps and works with addnormals. What it does it adds normal maps, and saves it into a new image, which gets compressed. All done automatically.

Posted

Yes, it's a fact. But can you tile second map, whether it's normal map or bump map ?

Sorry, I didn't read your question carefully. Greyscale images weight less than normalmaps and the effect is essentially the same.

It's only a model...

Posted

Anything is possible, I recall the roadblock to normal compression was mixing "grey-scale heightmaps" and normalmaps but it may be that BFG dropped heightmaps

altogether?

 

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

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Posted

Sorry, I didn't read your question carefully. Greyscale images weight less than normalmaps and the effect is essentially the same.

 

It has nothing to do with weighting less. It's about tiling over the model vs stretching. I am gonna have to make an example since people get confused with this.

Posted

Here is an example made in Blender:

 

 

Top node tree is normal map #1, that is baked from high poly. That one doesn't tile.

 

Bottom node tree is normal map #2, aka "details" normal map. That one needs to tile.

 

When I set mapping to 1, 1, 1 in the video, it shows what Doom 3 engine does by default. It stretches normal map #2 to fit UV space of the model. And the goal is to have it tiling, like I show further in the video.

Posted

@Biker: Here is an example material from Angua currently in-use:

 

 

 

 

 

 
// Author: angua
textures/darkmod/stone/sculpted/engraved_tile_star
{
    stone

    qer_editorimage    textures/darkmod/stone/sculpted/engraved_tile_star_ed
    diffusemap         textures/darkmod/stone/natural/light_grey_rough
    bumpmap            addnormals(textures/darkmod/stone/sculpted/engraved_tile_star_local, textures/darkmod/stone/sculpted/sarcophagus_stone02_roughness_local)

    {
        if ( parm11 > 0 )
        blend       gl_dst_color, gl_one
        map         _white
        rgb         0.40 * parm11
    }
    {
        if ( parm11 > 0 )
        blend       add
        map         textures/darkmod/stone/natural/light_grey_rough
        rgb         0.15 * parm11
    }

    // TDM Ambient Method Related
    {
        if (global5 == 1)
        blend add
        map                textures/darkmod/stone/natural/light_grey_rough
        scale            1, 1
        red                global2
        green            global3
        blue            global4
    }
    {
        if (global5 == 2)
        blend add
        program    ambientEnvironment.vfp
        vertexParm        0        1, 1, 1, 1        // UV Scales for Diffuse and Bump
        vertexParm        1        1, 1, 1, 1    // (X,Y) UV Scale for specular
        vertexParm        2        global2, global3, global4, 1

        fragmentMap        0        cubeMap env/gen1
        fragmentMap        1        addnormals ( textures/darkmod/stone/sculpted/engraved_tile_star_local , textures/darkmod/stone/sculpted/sarcophagus_stone02_roughness_local )            // Bump
        fragmentMap        2        textures/darkmod/stone/natural/light_grey_rough            // Diffuse
        fragmentMap        3        _black            // Specular
    }
}
 

 

 

 

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Posted

NPC's textures use addnormals, for example:

 

 

models/md5/chars/guards/citywatch/citywatch_armor      //used for pauldrons&helmet only    -- should now be redundant?
{
	qer_editorimage	models/md5/chars/guards/citywatch/cityguard_armor_ed
	surftype15
	description "armor_plate"
        noselfshadow


        bumpmap		addnormals( models/md5/chars/guards/citywatch/cityguard5_local, heightmap( models/md5/chars/guards/citywatch/cityguard_h, 2 ) )
        diffusemap     models/md5/chars/guards/cityguard_armor
        specularmap    models/md5/chars/guards/cityguard_s
    {
        if ( parm11 > 0 )
        blend       gl_dst_color, gl_one
        map         _white
        rgb         0.40 * parm11
    }
    {
        if ( parm11 > 0 )
        blend       add
        map         models/md5/chars/guards/cityguard_armor
        rgb         0.15 * parm11
    }

	// TDM Ambient Method Related 
	{							
		if (global5 == 1)		
		blend add				
		map				models/md5/chars/guards/cityguard_armor		
		scale			1, 1		
		red				global2	
		green			global3	
		blue			global4	
	}							
	{							
		if (global5 == 2)		
		blend add				
		program	ambientEnvironment.vfp	
		vertexParm		0		1, 1, 1, 1		// UV Scales for Diffuse and Bump	
		vertexParm		1		1, 1, 1, 1	// (X,Y) UV Scale for specular		
		vertexParm		2		global2, global3, global4, 1	
																
		fragmentMap		0		cubeMap env/gen1				
		fragmentMap		1		addnormals ( models/md5/chars/guards/citywatch/cityguard5_local , heightmap ( models/md5/chars/guards/citywatch/cityguard_h , 2 ) )			// Bump				
		fragmentMap		2		models/md5/chars/guards/cityguard_armor			// Diffuse			
		fragmentMap		3		models/md5/chars/guards/cityguard_s			// Specular			
	}
}

 

 

 

Question is whether you can scale the heightmap or the second normalmap. I suspect it's not possible.

It's only a model...

Posted

fragmentMap 1 addnormals ( textures/darkmod/stone/sculpted/engraved_tile_star_local , textures/darkmod/stone/sculpted/sarcophagus_stone02_roughness_local ) // Bump

Ah yes I have seen this before and alwasy wonder what it did/was.

 

bhm_banner.jpg

Posted
Ah yes I have seen this before and alwasy wonder what it did/was.

 

 

That particular line doesn't do anything. It's in the "if (global5 == 2)" block that is no longer used.

Posted

NPC's textures use addnormals, for example:

 

 

        bumpmap		addnormals( models/md5/chars/guards/citywatch/cityguard5_local, heightmap( models/md5/chars/guards/citywatch/cityguard_h, 2 ) )

 

 

 

Question is whether you can scale the heightmap or the second normalmap. I suspect it's not possible.

 

What is number "2" for in that line ?

Posted

 

What is number "2" for in that line ?

 

'heightmap(<map>, <float>) Turns a grayscale height map into a normal map. <float> varies the bumpiness.' -- https://www.iddevnet.com/doom3/materials.php

 

'An addition scale parameter is required when using height maps to determine how deep the image is supposed to be. You can’t properly cut and paste image fragments between height maps with different scale values without distorting the shading.' -- https://www.iddevnet.com/doom3/bumpmaps.php

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

  • 3 weeks later...
Posted

I'm pretty interested in the implications of this thread - if I wanted to make a model that:

- uses a normalmap from a high-poly version

- uses a stock texture, which also has a normalmap

 

Would it be right to say the only way to solve the normalmap conflict is to:

- duplicate the stock texture shader and let the new one use my model's normalmap

- and therefore adapt the high-poly mesh so that it also models details in the texture

 

Also, as far as I know every face needs to have its own place on the UV-map in order for hi-poly normalmap baking to function, which can be a problem with stock textures that weren't designed to fit the model's UV-map.

 

 

So it looks like stock textures are fairly unsuitable for models that have a normalmap from a hi-poly version.

  • Like 1

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

    • JackFarmer

      "The Year of the Rat." 
      😄

      Al Stewart must be proud of you!
      Happy testing!
      @MirceaKitsune
      · 0 replies
    • datiswous

      I posted about it before, but I think the default tdm logo video looks outdated. For a (i.m.o.) better looking version, you can download the pk4 attached to this post and plonk it in your tdm root folder. Every mission that starts with the tdm logo then starts with the better looking one. Try for example mission COS1 Pearls and Swine.
      tdm_logo_video.pk4
      · 2 replies
    • JackFarmer

      Kill the bots! (see the "Who is online" bar)
      · 3 replies
    • STiFU

      I finished DOOM - The Dark Ages the other day. It is a decent shooter, but not as great as its predecessors, especially because of the soundtrack.
      · 5 replies
×
×
  • Create New...