Jump to content
The Dark Mod Forums

New straw texture


Fidcal

Recommended Posts

I'm preparing a new straw texture plus crumb straw edge using the same alpha map as the grasses I did.

 

I've got a decent 3000 x 3000 high res texture and processed it for tiling. Technically it tiles and most of the extreme tiling artifacts I've removed but I'm still improving on that to try to minimise tiling effects even more. I'll do a normal map later using Njob. Here's a 256 x 256 snapshot. The final in-game texture will be 1024 x 1024.

post-400-130953372251_thumb.jpg

 

Question is, the scale is too large at the default 0.25 in DR and I prefer it to look about right at that scale. If I use scale in the shader do I need to put that on every stage (including the makealpha in the crumb edge version?) and is there a performance hit? Hopefully it scales it once only when it loads the shader. Or am I missing something here? Just creating a 2048 x 2048 makes no difference to the scale and anyway is overkill RAM-waste compared to most of our textures. Similarly, quadrupling the image to form a new image and sizing it down again is a waste of quality.

[EDIT] I think what I'm saying is that scaling it down means the tile is effectively very small. Seems odd when I started with a really good 3000 x 3000.

 

Another question: do I reduce the saturation? Some straw is more grey depending how dry maybe. Or should I make two versions? Or make it close to our current straw and bale model so they can be used together?

 

Also, I checked it out and hay is not the same as straw. Hay is dried grass used as animal food. Straw is the stems of wheat etc used for bedding. Putting straw in fodder troughs probably looks stupid to anyone who lives or works on a farm. Not that I plan to make any hay as well.

Link to comment
Share on other sites

Speaking as someone who would occasionally help to feed my cousin's horse - damned if I could tell you the difference at a glance between one kind of dried grass and another - I woudln't worry about that - the more texture options around for mappers, the better. =-3

"No proposition Euclid wrote,

No formulae the text-books know,

Will turn the bullet from your coat,

Or ward the tulwar's downward blow

Strike hard who cares—shoot straight who can—

The odds are on the cheaper man."

 

From 'Arithmetic on the Frontier' by Rudyard Kipling

Link to comment
Share on other sites

I don't know which stages scale needs to be put other than diffuse, frob, and maybe ambient? But I doubt that scale is very hard on the graphics card. My experiments with detail textures tell me they make little difference.

 

textures/darkmod/stone/brick/even_small_blocks01_detailtex
{
	stone

qer_editorimage textures/darkmod/stone/brick/even_small_blocks001_ed
diffusemap 	textures/darkmod/stone/brick/even_small_blocks01
bumpmap 	textures/darkmod/stone/brick/even_small_blocks001_local

{
blend gl_dst_color, gl_src_color
map textures/fence/detail/brick
scale 7, 7 // or whatever
}

{
	if ( parm11 > 0 )
	blend 	gl_dst_color, gl_one
	map 	_white
	rgb 	0.40 * parm11
}
{
	if ( parm11 > 0 )
	blend 	add
	map 	textures/darkmod/stone/brick/even_small_blocks01
scale			7, 7 	
	rgb 	0.15 * parm11
}

// TDM Ambient Method Related 
{							
	if (global5 == 1)		
	blend add				
	map				textures/darkmod/stone/brick/even_small_blocks01		
	scale			7, 7 	
	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		textures/darkmod/stone/brick/even_small_blocks001_local			// Bump				
	fragmentMap		2		textures/darkmod/stone/brick/even_small_blocks01			// Diffuse			
	fragmentMap		3		_black			// Specular			
}

yay seuss crease touss dome in ouss nose tair

Link to comment
Share on other sites

Another question: do I reduce the saturation? Some straw is more grey depending how dry maybe. Or should I make two versions? Or make it close to our current straw and bale model so they can be used together?

 

No need to make a second diffuse, unless it really looks different. Color corrections can always be done in the shader, esp. if you want it just a bit darker:

 

   red  0.9
   green 0.9
   blue 1.0

 

would remove a bit red and green, e.g. move it more towards "gray". If all fails, you can even add a bit of _white, or a flat colored second stage to it. This way you can have rubyred straw, if you desire :)

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

OK, thanks all. I'll use scale and use the red, green, blue to desaturate it in another shader.

 

This suggests to me though that all flat textures normally are to a certain fixed scale in the image that might be definable. For example, 1/1024th of the image side (eg, 1 pixel in a 1024 x 1024) per 0.1mm in real life. So this straw texture which I downloaded from cg textures originally was 3000 x 2000 was always going to be wrong - possibly in any game or modelling situation.

 

So do we take this into account when photographing original images? If you were photographing a section of brick wall and were too close then no matter what the resolution your picture might be to the wrong scale. If the scale is too small you can crop and throw away. If too big you can only scale it correctly in the shader.

Link to comment
Share on other sites

Further thoughts.... :) If we can use red green blue to make a second shader using the same image - does doom3 only load that image once into RAM even if both shaders are used? If so we could make dozens of more 'ram-free' textures of different colour variations without adding images. In any event we can do it if only one is loaded. For instance I made variations of the same fabric using multiple images. That was a waste surely?

Link to comment
Share on other sites

Further thoughts.... :) If we can use red green blue to make a second shader using the same image - does doom3 only load that image once into RAM even if both shaders are used? If so we could make dozens of more 'ram-free' textures of different colour variations without adding images. In any event we can do it if only one is loaded. For instance I made variations of the same fabric using multiple images. That was a waste surely?

 

Yeah, it only loads the texture only once. And if you are only using "RGB" to change the color, this is essentially free, because these are just numbers that are multiplied with each pixel. The downside is that you can only make things darker (by removing some color), not brigther.

 

Actually, I never tested, but maybe you can use "2.0" in the red part to actually increase the value? That would be cool.

 

The only downside is if you use an extra block to overlay a flat color image (which is unnec as you can just use RGB, but assume the flat color image is not flat,but has some pattern). Extra block means extra rendering pass.

 

However, one extra rendering pass is still better than having two textures loaded in a map I guess.

 

Oh, and you can only change the color globally, if you have a green and a blue fabric and they have other differences, you really need a new diffuse.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

More problems with this texture.

 

I improved the tiling so that's pretty good now.

 

I had to change vertexparms in the shader or it didn't scale in enhanced ambient rendering. This is the shader so far. No normal, specular or true editor image yet:

textures/darkmod/nature/grass/straw_thick02

{

surftype15

description "grass"

 

 

qer_editorimage textures/darkmod/nature/grass/straw_thick02

 

{

blend diffusemap

map textures/darkmod/nature/grass/straw_thick02

scale 4,4

}

 

{

if ( parm11 > 0 )

blend gl_dst_color, gl_one

map _white

rgb 0.40 * parm11

}

{

if ( parm11 > 0 )

blend add

map textures/darkmod/nature/grass/straw_thick02

scale 4,4

rgb 0.15 * parm11

}

 

// TDM Ambient Method Related

{

if (global5 == 1)

blend add

map textures/darkmod/nature/grass/straw_thick02

scale 4,4

red global2

green global3

blue global4

}

{

if (global5 == 2)

blend add

program ambientEnvironment.vfp

vertexParm 0 4,4,4,4 // UV Scales for Diffuse and Bump

vertexParm 1 4,4,4,4 // (X,Y) UV Scale for specular

vertexParm 2 global2, global3, global4, 1

 

fragmentMap 0 cubeMap env/gen1

fragmentMap 1 _flat // Bump

fragmentMap 2 textures/darkmod/nature/grass/straw_thick02 // Diffuse

fragmentMap 3 _black // Specular

}

}

 

 

 

The scale doesn't seem to work in DR. Is that a known problem? I guess I need to multiply the editor image by 4 and resize it back so it's made up of 4 normal tiles. Is that what we normally do?

 

In Enhanced ambient rendering there is a fake reflect sheen.

post-400-13095995087_thumb.jpg

 

This test room has only a fairly bright ambient_world with no directional lights at all. So why is the brush cube I made dark on the sides in normal and enhanced modes as if there is a light above it? It's correct in simple mode only.

post-400-130959953882_thumb.jpg

Link to comment
Share on other sites

there's two types of bales, there's straw made from the stalks of grinding crop like corn, wheat, barley. This is used as a bedding material for cows, and different breeds of horses, also on the floors of inns, as its good at soaking up liquids and other solids. the other type of bales is from dried grass, or oil seed rape after the seeds have been removed, this is used as feed for cows and horses, and anything else that eats grass like rhino's. so straws it the texture at the top, and dried grass is more greener and thinner than straw. as far as I know there aint any grass bales in the game.

Link to comment
Share on other sites

I've thought about this more and hay is a wispy fluffy grey dried grass (or similar) - that is, the leafy blades. Probably has some fine stems in there but mostly leafs because that is the edible part. Likely the farmer rests a crop field some years and lets it run to high meadow grass then scythes it and lets it dry. It is nutritious to grazing animals. We do have such a texture but I'm not certain of it's name without looking. I've got a patch in my test map I noticed earlier how different it is from straw.

 

Straw is not a leaf but the stems from wheat (or similar.) It's the leftovers after harvesting the cereal. Consider the other definition of straw - a hollow reed or dried out stem, a tube, mostly flattened in use. It is not nutritious to grazing animals. It is more yellow although I have an idea it will go more grey with age - and dirty underfoot.

 

Possibly my straw texture - scaled down a little more and greyed out might pass as hay to the non-expert but it does not lay the same way. Straw is fairly straight stems at many different angles whereas hay curves around.

Link to comment
Share on other sites

This new straw is working out fairly good now. All of the following use the same straw image...

post-400-130978844271_thumb.jpg post-400-130978846597_thumb.jpg

 

The main texture tiles very well. Works wall to wall but naturally has a hard edge.

There is an edge version using the same image that can be overlaid at hard edges. This tiles lengthwise along an edge like the grass ones.

There is also a patch version soft-edged all round. This doesn't tile but can be to cover up odd glitches or to extend small pieces.

There is also a scattered straw version. I'm really pleased with this. It can be used as normal scattered straw.

You can also lay two or three layers to thicken it. (see next post.)

You can also clone solid straw, raise it a few units and change it to scattered straw to give a 3D effect. As you walk across the straw you can partly see through the gaps to more straw below. You can't really see the effect in a screenshot.

What I might also add are some custom alpha maps. These would effectively be various shaped holes in the straw where it appears to thin out showing stone below. It will be useable on any surface and the same alpha maps could be used with grass for worn patches etc. You can already do that with the edges and patches but I think some alpha holes might be easier to use - be interesting over water too.

Link to comment
Share on other sites

Looking good there Fidcal.

In Enhanced ambient rendering there is a fake reflect sheen.

post-400-13095995087_thumb.jpg

You'll have to add a normalmap in order to fix that. The enhanced ambient method is dependent of the normal map. It accents it and adds a very small amount of cube reflection (IIRC), which is really hardly noticeable if you have a normalmap setup.

 

This test room has only a fairly bright ambient_world with no directional lights at all. So why is the brush cube I made dark on the sides in normal and enhanced modes as if there is a light above it? It's correct in simple mode only.

post-400-130959953882_thumb.jpg

Sorry, you gotta ask one of the masters (JC,Rebb) about this one I guess. Well, I at least got no clue. Simple mode is the old blend add stage, right? So it makes sense that that works properly, but why don't the real ones work as intended? Hmn... Maybe it's related to the interaction shader.

Link to comment
Share on other sites

Yeah, the Ambient Calculations now have some pre-baked directionality...

 

Which is great for shading Normal maps but can be problematic if the intended light direction differs. It would be cool if you could plugin your own Cubemap or change it's orientation.

 

Rebb previously expressed concerns over this attribute if I recall correctly.

 

Edit:

 

Yes, in JC Denton's first iteration, he had default Sky and Ground ambient color values to bias the Normal shading with:

 

http://www.doom3world.org/phpbb2/viewtopic.php?f=56&t=23226&start=0

Edited by nbohr1more

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

Link to comment
Share on other sites

Yeah it seem oriented to the vertical of the entity. So I did a sphere rotating vertically (like a ball rolling along but on the same spot.) The dark base and light top clearly rotated. A static upside-down aphrodite model looked very odd. Also if I put a static hanging from the ceiling it looked odd with the top side light and dark below.

 

The effect actually does look good apart from that orientation being fixed (and it would cover 99% of everything.) Plus of course, my test map very high ambient light never happens in a real FM.

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

    • OrbWeaver

      Has anyone had any luck with textures from Polyhaven? Their OpenEXR normal maps seem too washed out and give incorrect shading in the engine.
      · 5 replies
    • datiswous

      I tried to upscale the TDM logo video. First try:

      briefing_video.mp4 You can test it ingame by making a copy of the core tdm_gui.mtr and place it in your-tdm-root/materials/ , then edit line 249 of that file into the location where you placed the new briefing.mp4 file.
      What I did was I extracted all the image files, then used Upscayl to upscale the images using General photo (Real-Esrgan) upscale setting and then turn it back into a video.
      I might have to crop it a bit, the logo looks smaller on screen (or maybe it's actually better this way?). My video editor turned it into a 16:9 video, which I think overal looks better than 1:1 video of original.
      · 1 reply
    • nbohr1more

      Trying to be productive on my down-time before Capcom releases Akuma and my son is constantly on my PC playing Street Fighter...
      · 1 reply
    • OrbWeaver

      Finally got round to publishing a tutorial on baking normal maps in Blender, since most of the ones we have are inaccessible or years out of date.
      · 3 replies
    • 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
×
×
  • Create New...