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

Epi's Many Questions Thread

Recommended Posts

Yep, it uses a heightmap for faux shadow casting and maybe some other parallax tricks. I'm sure it's all in the wiki entry on textures.


What do you see when you turn out the light? I can't tell you but I know that it's mine.

Share this post


Link to post
Share on other sites

Really? https://www.iddevnet.com/doom3/bumpmaps.php just says of heightmaps that they 'must be converted to normal maps at load time'.

 

A search produces various old threads talking about parallax mapping mods for D3 and their desirability for TDM; was any of that implemented?


Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Share this post


Link to post
Share on other sites

You can extend the interaction shaders to include parallax but the default interaction shaders do not have it. Therefore heightmaps have no use here yet.

There may be a time in the future where the engine is improved to the point where the impact of parallax maps is negligible but currently it would have a significant

impact.

  • 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

Well that's okay, I just figured since I had some height maps handy I'd put the question out there. Switching topics (again xD) I have another one. After running some tests I found out that Vertex Paints work marvelous when using Lightwave 2015 that is... I would love to be able to spare the cash right now to use it, but I can't justify dishing out that much just to paint in my materials.

 

So that leaves me trying to find a demo (modtools) version to do my bidding. It's a shame all I want it for is a simple Vertex Paint, but it does exactly what I need. That being said, does anybody know of any backwater (old) copies out there available? Even if it's something much cheaper to purchase outright I'd consider, since all I really want to do is this final paint step. I know we have quite a few people here who've used it for a long time, so I figured it was worth a shot!


You need a model? Epi does you a model.



Toss me a PM I promise I don't bite.



Share this post


Link to post
Share on other sites

Greetings Pete! I ask a lot of questions as it's my many questions thread. Currently I've been trying to arm myself with various techniques to tackle different scenarios. Parallax mapping isn't the end of the world, it would just give me one more thing to bring out depth a bit more. So it's not a necessity, it would just be the icing on the cake.

 

However for Megatextures that's a different story. Laying down your baseline tiling textures is a start but lack much realism with their edging. Vertex Colors are a step in the right direction as it gives much more customization to how the materials are blended together (very good for exteriors using large spaces). Megatextures are obviously the most detailed and involved of the two choices. It's more time consuming but provides the best results as it gives the ultimate level of control. I have plans currently to map into 8k textures and section parts of the map accordingly. It's a slightly less mega version but I'm willing to try it out and see what we get.

 

Now you may be wondering why split it down? Well first I can't export a map higher than 8k with Substance Painter. I may also be able to combine four 8k maps into a single large texture as that should be enough pixel space for my current map. Substance Painter gives me a great deal of tools to really detail my meshes. So with the major walls and floors paint-able, it's crazy but it should look pretty awesome when finished. The best part is once I figured out my workflow it's actually not too hard. There's a lot of meshes that wont be in the, "megatextures". Smaller structural details that aren't tiled will have their own texture as usual. But when it comes to the unified painting method for larger tiled areas, the larger the better. It's just easier since it's less divided.

 

Hope that answers some of your questions. Hopefully you'll be seeing some of my work on this next project shortly!


You need a model? Epi does you a model.



Toss me a PM I promise I don't bite.



Share this post


Link to post
Share on other sites

Random question as always guys. Is there a recommended blend mode to be used for custom lightmaps? Yes this does mean I'm making considerations for manually setup and baked lightmaps. Not sure TDM would even look like it ran on the same engine were it done right. Wouldn't even have to be at a high resolution, but it would look mighty fancy. :P

 

Depending on the target hardware the constraints are considerable. That and just how easy it is to mimic my light values and positions from DR back into Softimage. My modeling app supports a rendermap feature that allows me to save lighting data onto a texture (either with or without the diffuse).

 

Also something on that same line, would there be a blend function that could be disabled or culled out by direct light sources? Manual lightmaps would be super if we didn't have moving lights like the lantern or NPCs with torches. Otherwise pointing a dynamic light at a dimly lit area would still be dim, even with the lights. Just some more crazy Epi-thoughts of the night. :wacko:

Edited by Epifire

You need a model? Epi does you a model.



Toss me a PM I promise I don't bite.



Share this post


Link to post
Share on other sites

I suppose the nearest thing to a lightmap currently is lights/shadows/shadow_canopy6, but I can't really call that 'recommended', just something to look at while experimenting.

  • Like 1

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Share this post


Link to post
Share on other sites

I baked shadows on the floor in the Xmas map. However they were later covered by normal shadows, so they were difficult to notice. Also they don't disappear when fire is put out. Having light (blend add) instead of shadows (blend filter) would make more sense, but I remember the latter looked better.

 

QM33KdJ.jpg

  • Like 3

It's only a model... /// My channel on YouTube

Share this post


Link to post
Share on other sites

Well as long as the lightmaps weren't overlapping to active fires that could be put out, each light could have it's on/off state tied to a toggling skin too. This tells me a lot, but just out of curiosity what was your lightmap resolution set at?

 

My whole purpose I want to do is be able to throttle the amount of darkness, back beyond the ambient_light mainly for dark (barely accessible) areas of the map. Primarily corners and low spots that are too far removed from light sources to be receiving much light. What it should end up doing is give me two dark thresholds of light. The darkest being the lightmaps that blend into the ambient world light. It would also help prioritize more important areas of the map to lead the player by light.

Edited by Epifire

You need a model? Epi does you a model.



Toss me a PM I promise I don't bite.



Share this post


Link to post
Share on other sites

Epi, first of all, its awesome that youre going to try and use the megatexture feature, by the sound of it, yours might well be the most detailed and visually complex tdm map yet. Thats pretty cool.

 

As for the lihtmaps, Im guessing they would look great on outdoor scenes, with moonlight and so on, or sections of the map where you will only be going around fixed, perhaps non extinguishable lights. Because Im not sure how baked shadows would look like when you pick up candles and move them around the place. Maybe you can ban moveables in your map, and water arrows. But you can still get rid of the ambient light on certain areas, to get realistic depth on dark environments, by using location entities. Theres a function that allows for different ambient light levels between areas, all you have to do is to mask the transition somehow, because when you enter the new area, the ambient will adjust and you can notice it. You can get true dark areas like this, while still mantaining an ambient on brighter areas, like the outdoors. Another trick you can use to get depth is to use fog, a black or dark blue fog to create that sort of eye perception radius, to simulate how far you can see details in dark environments. Tels was even doing a few tests where you would attach a fog light to the player, and by giving it a wide radius, give you that subtle feel that things far off have less detail than whats up close. I dont think hes been around much hese days, but his swiftmaze site offers a description of that, Im sure it could give you ideas.

Share this post


Link to post
Share on other sites

Worth mentioning that dynamic soft shadows are in the pipeline, not for 2.04 or even 2.05 afaik, but on the horizon. We're usually discouraged from mentioning it because it's still buggy and may not see the light of day. But if that's what you're after, that's a consideration for your cost-benefit thinking of baking's added value over the long term.

 

There was also occlusion (ssao), but I couldn't even tell the difference in night time conditions tbh (it only really works in daylight apparently), and it's a big performance hit. But I'd imagine trying to bake it in would also be kind of unimpressive for our dark environments.

 

Tels dynamic ambient and distance fading tricks may be worth something.


What do you see when you turn out the light? I can't tell you but I know that it's mine.

Share this post


Link to post
Share on other sites

Hey guys, when I need to start sending the Castle Lab to folks for testing is there a standard method for packing a mission easily? Like right now it's kinda a pain because I have to go and rummage all my content folders to pull out all the models, skins and anything else I've customized for a level. I was looking in the beginners guide and they just covered compiling.

 

Are there any pack tools that just pack by in manner by used assets in a level? I know we had something similar with BSP stuff back in my Source modding days. I mean I can certainly just smack all the contents into a pk3 but it'll get really time consuming to do that a lot for iterative testing periods.

Edited by Epifire

You need a model? Epi does you a model.



Toss me a PM I promise I don't bite.



Share this post


Link to post
Share on other sites

You only have to do it once, ever.

 

Once you've put your files into the right structure, you can install your mission in both TDM and DR whether it's zipped up into a pk4 or not.

 

Make a folder myMission/ in your darkmod/fms folder.

 

Put your top-level folders in there named like they are in TDM: maps/, materials/ etc

Add your files and add your darkmod.txt and startingmap.txt to the myMission/ folder.

 

If you want to override any of TDM's standard files, you just add the same-named file to your mission folder. Your version will override the game's own version.

 

After that you can install your mission and run it in TDM, and edit the files at will. You don't need to make a pk4 until you want to distribute it. Then you just have to zip up your myMission folder and rename it .pk4

 

More info here: http://wiki.thedarkmod.com/index.php?title=How_to_pack_your_Mission

  • Like 1

Share this post


Link to post
Share on other sites

Super! That's exactly what I was needing, strange I didn't run into that earlier on my search in the wiki.

 

Other idea I've had in mind for more lighting control... Can we use animated/scrolling textures cast through a light as a material? I had this crazy idea about having a smooth transition when opening or closing a door.

 

This is a tangent I ran off on earlier when I decided I'd cast some shadows through a light material so I could have soft edges. The idea is to bake a shadow of an operating table (when finished) and then bake a really creepy shadow of the silhouette to cast with a light for the final result. Then I came up with the idea of a door way or moving objects in shadows.

 

On second thought something like a fan shadow or something would be super beast with this. As stop/start times wouldn't need to be timed specifically. All these ideas, it's no wonder I get so side tracked. :rolleyes:


You need a model? Epi does you a model.



Toss me a PM I promise I don't bite.



Share this post


Link to post
Share on other sites

Gonna be trudging through materials to find appropriate definitions, but does anybody have good references they know of for a refracting material? I'm wanting to make some glass with specific cuts and angles that would distort the image behind it. I should only need a normal map and some diffuse information as I'm assuming, but I haven't actually done that in this engine yet.

 

Shortly I'll be baking some glass here, but I was kinda hoping some of ya'll has some tips as to good glass makings. Should be fairly straight forward after the modeling portion but I'm more curious as to what goes on for the glass warp. Most the materials I've already looked at use more generic methods, whereas I'm wanting to use direct input maps to control the distortion/specular effects.


You need a model? Epi does you a model.



Toss me a PM I promise I don't bite.



Share this post


Link to post
Share on other sites

I think the heatHaze program is what you're looking for, the stained glass window materials AluminumHaste made might be a good starting point: http://forums.thedarkmod.com/topic/17203-transparent-stained-glass/

 

For pointers, I've not done glass but the heathaze should distort the image behind it with the normalmap you provide, get a cubemap or a mirror stage on top of that if you want reflection as well.

 

I've been playing with blending modes some more and I think any blendmode that references an alpha (eg gl_dst_alpha) actually means the opacity the material has rather than any abstract alpha value or alpha channel on an imagemap you feed the material. Pretty restrictive.

  • Like 1

My FMs: The King of Diamonds (2016)



| Visit my Mapbook thread sometimes! | Read my tutorial on Image-Based Lighting Workflows for TDM! |

Share this post


Link to post
Share on other sites

I've been playing with blending modes some more and I think any blendmode that references an alpha (eg gl_dst_alpha) actually means the opacity the material has rather than any abstract alpha value or alpha channel on an imagemap you feed the material. Pretty restrictive.

Are you using maskAlpha/maskColor to make sure other stages aren't overwriting the channels? Here's an opaque material that uses an image map:

 

 

 

textures/darkmod/window/ornate/descriptive_name_goes_here
{

	glass

	qer_editorimage textures/darkmod/window/ornate/round_pearly_white_ed
		
	bumpmap		textures/darkmod/window/ornate/round_pearly_white_local
	diffusemap _black
	specularmap	textures/darkmod/window/ornate/round_pearly_white_s
	{
	blend add
	map textures/darkmod/window/ornate/round_pearly_white
	red 0
	green 0
	blue 1
	}
	{
	blend filter
	map textures/darkmod/window/ornate/round_pearly_white
	red 0.1
	green 0.1
	blue 0.4
	}
	{
        maskcolor				
        map makeAlpha(lights/spot01)
        }	
	{
		blend gl_dst_alpha, gl_one
		maskAlpha
		cubeMap env/gen2
		texgen	reflect
	}
	{
	blend gl_dst_alpha, gl_one
	maskAlpha
	map textures/darkmod/window/ornate/round_pearly_white
	red 0.4
	green 0.4
	blue 0.6
	}
	
	{
		if ( parm11 > 0 )
		blend	gl_dst_color, gl_one
		map		_white
		rgb		0.40 * parm11
	}
	{
		if ( parm11 > 0 )
		blend	add
		map		textures/darkmod/window/ornate/round_pearly_white
		rgb		0.15 * parm11
	}

	// TDM Ambient Method Related
	{
		if (global5 == 1)
		blend add
		map				textures/darkmod/window/ornate/round_pearly_white
		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		textures/darkmod/window/ornate/round_pearly_white_local			// Bump
		fragmentMap		2		textures/darkmod/window/ornate/round_pearly_white			// Diffuse
		fragmentMap		3		textures/darkmod/window/ornate/round_pearly_white_s			// Specular
	}


}

 

 

  • Like 1

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Share this post


Link to post
Share on other sites

Ah yeah, great points to start out with. It probably would be under the heat haze program that I'm needing. To be fair I really don't want to do a lot to it, I mainly just want to get the distorting with some slight color variation. Kinda like this example here...

 

 

 

546d525212879.jpg

 

 

 

With source that's literally just a diffuse and normal map with a additional block to define that it's a refracting shader. I'm not looking to do a lot more than that really.

Edited by Epifire
  • Like 2

You need a model? Epi does you a model.



Toss me a PM I promise I don't bite.



Share this post


Link to post
Share on other sites

Are you using maskAlpha/maskColor to make sure other stages aren't overwriting the channels? Here's an opaque material that uses an image map:

 

 

 

textures/darkmod/window/ornate/descriptive_name_goes_here
{

	glass

	qer_editorimage textures/darkmod/window/ornate/round_pearly_white_ed
		
	bumpmap		textures/darkmod/window/ornate/round_pearly_white_local
	diffusemap _black
	specularmap	textures/darkmod/window/ornate/round_pearly_white_s
	{
	blend add
	map textures/darkmod/window/ornate/round_pearly_white
	red 0
	green 0
	blue 1
	}
	{
	blend filter
	map textures/darkmod/window/ornate/round_pearly_white
	red 0.1
	green 0.1
	blue 0.4
	}
	{
        maskcolor				
        map makeAlpha(lights/spot01)
        }	
	{
		blend gl_dst_alpha, gl_one
		maskAlpha
		cubeMap env/gen2
		texgen	reflect
	}
	{
	blend gl_dst_alpha, gl_one
	maskAlpha
	map textures/darkmod/window/ornate/round_pearly_white
	red 0.4
	green 0.4
	blue 0.6
	}
	
	{
		if ( parm11 > 0 )
		blend	gl_dst_color, gl_one
		map		_white
		rgb		0.40 * parm11
	}
	{
		if ( parm11 > 0 )
		blend	add
		map		textures/darkmod/window/ornate/round_pearly_white
		rgb		0.15 * parm11
	}

	// TDM Ambient Method Related
	{
		if (global5 == 1)
		blend add
		map				textures/darkmod/window/ornate/round_pearly_white
		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		textures/darkmod/window/ornate/round_pearly_white_local			// Bump
		fragmentMap		2		textures/darkmod/window/ornate/round_pearly_white			// Diffuse
		fragmentMap		3		textures/darkmod/window/ornate/round_pearly_white_s			// Specular
	}


}

 

Yes, I was, it seems my map for maskAlpha was the problem however. Too black I think. It looks proper now. While I have you attention, how's the "red/green/blue Parm0*0.2" in the cubemap stages supposed to work? Does it work? Neither that nor the "rgb 0.2" I've seen seem to affect the brightness of the cubemap. Not bogarting the thread or anything, it's relevant to windows.

 

Reference from the thread I posted:

 

 

   {
        blend gl_dst_alpha, gl_one
        maskalpha
        cubeMap env/gen1
        // tone down the reflection a bit
        red     Parm0 * 0.2
        green   Parm1 * 0.2
        blue    Parm2 * 0.2
        texgen  reflect
    }

 

Edited by Spooks
  • Like 1

My FMs: The King of Diamonds (2016)



| Visit my Mapbook thread sometimes! | Read my tutorial on Image-Based Lighting Workflows for TDM! |

Share this post


Link to post
Share on other sites

I almost asked you the same question. :unsure:

 

@Epi Here's an opaque window material that uses heathaze with a bumpmap made from one of the light textures; hopefully it'll be useful if you compare it to the transparent glass materials:

 

 

textures/darkmod/glass/glass_tdm_stained_glass_clear {
	solid
	noSelfShadow
	noshadows
	//discrete
	//forceoverlays
	forceOpaque
	//sort decal
	glass
	qer_editorimage textures/lights/tdm_stained_glass_clear
	
	bumpmap heightmap(textures/lights/tdm_stained_glass_clear,1)
	{
	blend diffusemap
	// Highlight colour of the glass when reacting to light sources, not of any 'light' shining from 'behind' it. Needs an additive blend or gl_dst_color, gl_one in the cubemap stage to be effective.
	map _white
	red 0.25
	green 0.25
	blue 0.25
	
	vertexProgram heatHazeWithMaskAndDepth.vfp
	vertexParm 0 0, 0 // texture scrolling
	vertexParm 1 0.05 // magnitude of the distortion
	fragmentProgram heatHazeWithMaskAndDepth.vfp
	fragmentMap 0 _white
	fragmentMap 1 heightmap(textures/lights/tdm_stained_glass_clear,1) // the normal map for distortion
	fragmentMap 2 invertColor(textures/lights/tdm_stained_glass_clear) // the distortion blend map
	fragmentMap 3 _currentDepth
	}
	{
		//blend add
		cubeMap env/gen2
		texgen reflect
	}
	
	// To add a tint regardless of real illumination:
/*	{
		blend add
		map _white
		red 0
		green 0
		blue 0.05
	}
*/
/*	{
		blend add
		map textures/lights/tdm_stained_glass_clear
		red 0.3
		green 0.2
		blue 0
	}
*/
}

 

 

Edited by VanishedOne
  • Like 1

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Share this post


Link to post
Share on other sites

I almost asked you the same question. :unsure:

 

You're in luck, I just figured out a way!

 

Looking over those material stages just now, I'm seeing the use of red/green/blue and a float value between 0 and 1 to modify the RGB value of the map. Well, when you make an alpha stage with makeAlpha, the resulting image wouldn't have any RGB values, just a grayscale alpha value.

 

So, for a cubemap that's blended with gl_dst_alpha and a makeAlpha stage defining said alpha, this is how you can make the cubemap less bright:

{
maskcolor
map makealpha (textures/darkmod/tile_s_bright) //here I use the specular of the texture
alpha 0.5		//this darkens the alpha by half, modify it as you wish
}
	
{
blend gl_dst_alpha, gl_one
maskalpha
cubeMap      env/gen2
texgen      reflect
}

As you can see, this lowers the output of the cubemap by darkening the alpha stage it's drawn with, so there's caveats - using other blending types on the cubemap stage will invalidate this method and if you're using that alpha stage for something else this might break the appearance of that. I still don't know why the rgb argument doesn't work on the cubemap stage proper (and no, "alpha" doesn't work either), but my best guess is "cubemaps are magic" and they don't obey the rules.

  • Like 2

My FMs: The King of Diamonds (2016)



| Visit my Mapbook thread sometimes! | Read my tutorial on Image-Based Lighting Workflows for TDM! |

Share this post


Link to post
Share on other sites

I wonder whether it would then be possible - though very cumbersome and inefficient - to use maskRed, etc. to colour a cubemap by writing to each colour channel in a separate cubemap stage, since you can't just do this:

{
blend gl_dst_alpha, gl_one
maskalpha
cubeMap      env/gen2
texgen      reflect
red 0.5 // e.g.
green 0
blue 0.2
}
  • Like 1

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Share this post


Link to post
Share on other sites

It seems to me that the rgb parameters work on cubemap stages ONLY when there are no diffuse/bumpmap/specular map blending stages set on the material. For Epi's purposes, if he wants to only use the heathaze program + any other material stage with a blend add/filter/etc. he can tint the cubemap fine.

 

For opaque materials that need light interaction though, yeah, the method you described seems to be the only way to tint cubemaps. I've just tried it and it works, you have to define a new alpha stage above each of your three cubemap stages and put MaskRed etc. on them. Then you control each color's intensity through the alpha arguments of the makeAlpha stages above the corrseponding cubemap ones.

 

Of course, easy way's just make a new, colored cubemap with the envshot command, but that's one thing, the ability to tint them in the material is another, so it's good to know it's at least possible.

 

Edit: here's the code

 

 

diffusemap 		textures/darkmod/tile
bumpmap 		textures/darkmod/tile_local
specularmap		textures/darkmod/tile_s_bright

//For RED
{
	maskcolor
	map makealpha (textures/darkmod/tile_s_bright) 
	alpha 0.7
}

{
        blend gl_dst_alpha, gl_one
	maskalpha
	maskGreen
	maskBlue
        cubeMap      env/gen2
        texgen      reflect
}

//For GREEN
{
	maskcolor
	map makealpha (textures/darkmod/tile_s_bright) 
	alpha 0.3
}

{
        blend gl_dst_alpha, gl_one
	maskalpha
	maskRed
	maskBlue
        cubeMap      env/gen2
        texgen      reflect
}

//For BLUE
{
	maskcolor
	map makealpha (textures/darkmod/tile_s_bright) 
	alpha 0.6
}

{
        blend gl_dst_alpha, gl_one
	maskalpha
	maskRed
	maskGreen
        cubeMap      env/gen2
        texgen      reflect
} 

 

 

 

edit edit: note that you can use different cubemaps for each of these makeshift "color stages", so you can go hog wild there if you wanted to do some super trippy effect. I mean it is cumbersome, but it's also pretty flexible.

Edited by Spooks
  • Like 2

My FMs: The King of Diamonds (2016)



| Visit my Mapbook thread sometimes! | Read my tutorial on Image-Based Lighting Workflows for TDM! |

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