Jump to content
The Dark Mod Forums
Sign in to follow this  
peter_spy

My first map – questions & work in progress

Recommended Posts

By the way, for detail textures we have an example implementation:

 

http://wiki.thedarkmod.com/index.php?title=Detail_Textures


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...)

Share this post


Link to post
Share on other sites

I really don't get the syntax of those image programs, this should work, but doesn't

 

{
blend bumpmap
map addnormals(textures/tut/base/wall01_n, scale(textures/tut/base/wall01_dt, 0.5) )
}

 

Edit: nvm, this is just a minor thing, I was just curious whether this works.

Edited by Judith

Share this post


Link to post
Share on other sites

you can always cheat with models and use darkradiant to make the models, then export them as ase files, then you don't have to mess with textures or material files if you use the darkmod textures for the models.

Share this post


Link to post
Share on other sites

Well, that won't work for me, since I'll be making most of the models myself in 3dsmax, and most of them will be UV'd. Same goes for textures. But, I basically checked for everything I need, I only have to take a closer look at glowing stuff, because in my first tests there wasn't enough glow ;) (there was no bloom effect or anything)

Share this post


Link to post
Share on other sites

OK, to be clear there are two scale keywords. One is to change the size and requires X and Y sizing:

 
    {
      blend bumpmap
      map   addnormals(textures/tut/base/wall01_n, textures/tut/base/wall01_dt )
      scale 2, 2   // tile 2x (shrink)

    }

To enlarge, make fractional scale. Eg: scale 0.5, 0.5 doubles the stretch.

 

https://modwiki.xnet.fi/Scale_(Material_stage_keyword)

 

 

The other is an "image program" and requires all 4 parameters. Red Green Blue Alpha.

 
    {
      blend bumpmap
      map   addnormals(textures/tut/base/wall01_n, scale(textures/tut/base/wall01_dt 1, 1, 0.5, 1) )
      // reduce blue channel by 50 percent in the 2nd normal map
    }
  • Like 1

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...)

Share this post


Link to post
Share on other sites

Yup, I tried the keyword yesterday, but it applies to both normals, not just the second one. Image program allows me to blend normalmaps only. Anything I add makes textures go black and I get messages like this in the console:

 

Clipboard02.jpg

 

Then again, it's no biggie if it doesn't work, I got everything else down, and that's all I need. Besides, slapping detail normals everywhere might hurt the performance.

Edited by Judith

Share this post


Link to post
Share on other sites

Ah, my mistake then!

 

You need a comma after the material path too!

 

 

 
{
      blend bumpmap
      map   addnormals(textures/tut/base/wall01_n, scale(textures/tut/base/wall01_dt, 1, 1, 0.5, 1) )
      // reduce blue channel by 50 percent in the 2nd normal map
 }
 

 

I should've looked at my own wiki article. :blush: :D


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...)

Share this post


Link to post
Share on other sites

Alright, we're going somewhere, both normals show up, but there's no scaling going on. Where should I actually put the scale values, if everything is taken up by the RBGA values in that expression?

 

Edit: I just thought of another solution, since detail normals would be separate special-purpose textures, I can make them without the blue channel anyway. This way a shader operation in material file will no longer be necessary.

Edited by Judith

Share this post


Link to post
Share on other sites

If I understand your request correctly, you want to resize one normalmap and then merge it with another?

 

As I understand it, even just listing multiple stages will allow you to combine normals so you could do this:

 
{
      blend bumpmap
      textures/tut/base/wall01_n
      rgb 0.5 // 50 percent weight
  
}
 
{
 
   blend bumpmap
   scale(textures/tut/base/wall01_dt, 1, 1, 0.5, 1) // reduce blue
   scale 2, 2 // shrink texture scale x2
   rgb 0.5 // 50 percent weight
 
}
 

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...)

Share this post


Link to post
Share on other sites
If I understand your request correctly, you want to resize one normalmap and then merge it with another?

 

Yes, that's a trick from Gears or UT3 era, you multiply tiling detail normal with RGB 1,1,0 to lose the blue channel and add it on the top of the base normal to make another "layer of details" appear when player gets closer

 

And your example is still wrong, not only because the scale image program is still there along with the global keyword, but even if you correct that and split blending normals into two stages, only the last one is taken into account. Use your own textures with this example if you like to see what happens:

	{
		blend bumpmap
		map	textures/tut/base/wall01_n
		rgb 0.9  
	}
 
	{
		blend bumpmap
		map textures/tut/base/wall01_dt
		scale 8, 8
		rgb 0.1
	}
Edited by Judith

Share this post


Link to post
Share on other sites

Yes, now I remember my experiments and Rich's example better. Each normal is tied to it's own set of diffuse an specular.

To make a second normal map show, it must be paired to a second diffuse and the weight must be done on the diffuse:

 

 

 
{
        blend bumpmap
        map    textures/tut/base/wall01_n
        


}

{

             blend diffusemap
             map textures/tut/base/wall01_d
             rgb 0.9

}

{             
             blend specularmap   
             map textures/tut/base/wall01_s
             rgb 0.9

}
    

{
     blend bumpmap
     map textures/tut/base/wall01_dt
         scale 8, 8
        

}

{

             blend diffusemap
             map textures/tut/base/wall01_d
             rgb 0.1

}

{             
             blend specularmap   
             map textures/tut/base/wall01_s
             rgb 0.1

}
 
  • Like 2

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...)

Share this post


Link to post
Share on other sites

Now that works. Actually rgb .5 in is a good starting point. They have to balance each other out, so you don't get any excessive colors from anything.

 

Crude example:

tut_2017_02_07_17_54_05.jpg

Edited by Judith
  • Like 4

Share this post


Link to post
Share on other sites

Glad to see it working better now (*now that I've cleaned the dust outta my mind).

 

You still should be able to use scale(textures/tut/base/wall01_dt, 1, 0.5, 1, 1) on the 2nd bump stage to reduce the blue or any other

color in the normal (or all of them) so you have two control points I believe. As per my fiddling with image maps to invert you can probably

just reduce all colors to lessen the intensity of the normals to... eg scale(textures/tut/base/wall01_dt, 0.5, 0.5, 0.5, 1). Hard to say which is

the best approach.

  • Like 1

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...)

Share this post


Link to post
Share on other sites

Alright, hopefully this is my last question about shaders in a long time, and something totally optional, but I'm curious: has anyone tried making a fresnel material?

Edited by Judith

Share this post


Link to post
Share on other sites

Isn't Fresnel an algorithm used for specularity. I think those term appears in the interaction shader.

 

In regardence to the effect in the linked article, if you want to express the rims a bit more then I guess this is more a shader thingy then a material thing, which is probably good, as any change will affect all materials.

 

Edit: Regarding the math that gets used in the article it will probably something like this:

 

fresnel_intensity = (1-v*n)^fresnel_exp

 

whereas v is the view to surface vector (normalized)

n is the surface normal

fresnel_exp as noted in the article

* denotes the dot product

and ^ the power

  • Like 1

FM's: Builder Roads, Old Habits, Old Habits Rebuild

WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Share this post


Link to post
Share on other sites

Taking a look at the enhanced interaction shader it seems that what gets described in the article is already part of the shader program. The exponential used is 4.

 

EDIT: The program is test_direct.vfp in the glprogs folder.


FM's: Builder Roads, Old Habits, Old Habits Rebuild

WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Share this post


Link to post
Share on other sites

I've found this article on ModWiki, will try that shader program at some point. As you know, fresnel is used mostly to give rim light effect to key objects and characters to make them stand out a bit from the environment. It's also used as frob / interaction shader, which is a bit better than just a "frob highlight" in well-lit environments. I was thinking about using it for a few important objects, but a subtle emissive / glow map should do as well.

 

Edit: IMO TDM's interaction shader doesn't look like it has a fresnel program in place, for both default and enhanced version:

 

volta1_1_2017_02_13_12_22_11.jpg volta1_1_2017_02_13_12_22_29.jpg

Edited by Judith

Share this post


Link to post
Share on other sites

That's the fresnel.vfp rich mentioned. It is shipped with the mod.

 

Using rim hilighting for frob hilighting is an interesting idea.


FM's: Builder Roads, Old Habits, Old Habits Rebuild

WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Share this post


Link to post
Share on other sites

That's the fresnel.vfp rich mentioned. It is shipped with the mod.

 

Using rim hilighting for frob hilighting is an interesting idea.

 

It's pretty much a standard way of implementing interaction highlight in games now. The only problem I have with it is that often it's very heavy-handed (case in point: Bioshock).

Share this post


Link to post
Share on other sites

I found a lone example.

textures/water_source/water_reflective

{





    qer_editorimage textures/glass/glass1

    translucent

    noshadows

    nonsolid



    {

        blend    blend

        mirrorRenderMap 512    512

        translate    0.5, 0.5

        scale        0.5, 0.5



        program fresnel.vfp

        vertexParm    0    .5

        fragmentMap    0    _scratch

    }





}

It also looks like someone wrote a wiki article that references the shader.

Share this post


Link to post
Share on other sites

Yup, I linked that above. I haven't tested the water yet, but if that program is used in the interaction shader, it doesn't work like it should.

 

Edit: the example of highlight / interaction shader in Dishonored 2:

 

Clipboard01.jpg

Edited by Judith
  • Like 2

Share this post


Link to post
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.

Sign in to follow this  

×
×
  • Create New...