Jump to content
The Dark Mod Forums

RPGista's mapping and modeling thread


RPGista

Recommended Posts

Excellent job!

 

Don't worry about making a movable entity...this model will overwrite the old one when it is ready and will use the existing entitydef.

 

Will this be in 1.08?

 

 

I wasn't planning on working on merging replacement assets until 1.09.

Link to comment
Share on other sites

Thanks guys. Here's the finished model (after a lot of tests, appearently the "smoothing problem" was actually being caused by normal map UV seams, they are corrected now; + shadow and collision):

 

http://www.sendspace.com/file/r7viv6

 

PS: Grayman, if you are planning on using the skull in your map, please go ahead.

  • Like 1
Link to comment
Share on other sites

Quick question: first time dealing with alpha textures, where exactly should I look for a template material for a 2-sided, transparent texture for a bush model I'm importing to TDM?

 

shot00001yx.jpg

 

PS: Would a translucency layer possible for Doom's material shaders? It is provided with the model. Here's the render preview btw (seems a lot denser though):

 

previewhqa.jpg

Edited by RPGista
  • Like 1
Link to comment
Share on other sites

The two relevant keywords in the material shader are "twosided" and "alphatest". The alphatest value says "every value in the alpha layer smaller than this gets transparent, everything else solid" (there is no blending, its a 1 or 0).

 

8D3 has unfortunately no real alphablending where different parts of the texture canbe differently transparent, it is either 1/0 alphatest or the default 50% translucency :(

 

 

Example material:

 

textures/darkmod/decals/vegetation/ivypatch_average01

"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

Thanks Tels, I was able to make it work by picking up strings here and there. Still a problem though, the bush model has faces pointing to all sorts of directions, and the result is visually quite bad. Is there a particular way to avoid the back faces from being so dark?

 

shot00003jy.jpg

 

shot00001yh.jpg

 

The second one has a normal map that seems to draw light to the back faces, I remember there was a post about this, you could make it seem like the light was passing through the leaves with a normal map trick, would that be the solution?

Link to comment
Share on other sites

Yes, that might work. Also, sometimes the normals on such plants are "warped", to give them a more 3D view. Maybe that would help?

 

Here is the thread about it:

 

http://forums.thedarkmod.com/topic/11515-real-translucency-anyone/page__view__findpost__p__225867

"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

Is there a particular way to avoid the back faces from being so dark?

 

If you find a good one, let me know. I've actually had to use a very subtle alpha blend...it keeps the back faces from being black, but then the entire plant seems to glow softly in pitch darkness. It's not terribly noticable in ambient light, but still not ideal.

Link to comment
Share on other sites

Looking back at that thread and after experimenting a bit, incorporating a then seemingly ignored suggestion by Orbweaver, this material seems to work ok - without having to apply vertex color to the mesh first :

 

textures/darkmod/decals/vegetation/ivy_bush_up_translucent
{
surftype15
description "foliage"

nonsolid
noimpact
noshadows
noselfshadow
twosided

{
	blend	bumpmap
	map		models/darkmod/props/textures/ivy1_local
}
{
	blend	diffusemap
	map	models/darkmod/props/textures/ivy1_d
	alphatest	0.5
	rgb 0.75 // controls the amount of "front brightness"
}
{
	blend	bumpmap
	map		scale( models/darkmod/props/textures/ivy1_local, 1, 1, 0, 1 )
}
{
	blend	diffusemap
	map	models/darkmod/props/textures/ivy1_d
	alphatest	0.5
	rgb 0.5 // controls the amount of "back brightness"
}

// TDM Ambient Method Related
{
	if (global5 == 1)
	blend add
	map				models/darkmod/props/textures/ivy1_d
	scale			1, 1
	red				global2
	green			global3
	blue			global4
}
}

Link to comment
Share on other sites

It invertes the normal map.

"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

By doing what? How does changing the scale invert it?

 

Also, how is it possible to have two different diffuse stages, and how does that shader know which side is front and which is back?

 

Lots of stuff going on there that I don't understand. :huh:

Link to comment
Share on other sites

The shader always draws both stages one after each other. (You can have as many diffuse or other stages as you want)

 

If you look at one side (front), it draws one part 0.75 (75%), the other 25%. If you look at the other side, it it the same.

 

The scale() commands multiplies each channel with 1, 1, 0, 1, which means X * 1, Y * 1, Z * 0, alpha * 1. Which effectively nulls out the Z value.

 

Since the material is twosided, both sides will exist, but during rendering only the side that you are facing is drawn.

 

(Or that is how I understand it, rebb could explain it better)

"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

After a lot of frustrating tests, I "think" I got it to work but unfortunately it didn't change the darkness of the black faces at all. I say I think I got it to work because I can see the shadow of a held object projecting through a back face, like Rich's video example, but since I can barely notice any change to the surfaces when I put a light behind the leaves, I'm not entirely sure.

 

Rebb - thanks a lot for putting this shader together, it really helped me as I was a bit lost there. :) I couldnt put the shader provided by Rich to work with the model, but I was wondering about the second blend diffuse map in yours, for the back; it lists the same image as the front one. It is said in the original thread that they should be different, otherwise you wont get to notice the transparency? I did pointed at a different image, but I just wanted to check because if possible we could save in file size and work just by using the same diffuse.

 

Here's the model right now if anyone is interested in taking a look:

 

http://www.sendspace.com/file/bmb2qu

Edited by RPGista
Link to comment
Share on other sites

I checked your model and it does show some areas that stay very dark no matter what.

Maybe my tests were too simple ( using patches ), and it does indeed require vertex-color on the mesh to work properly ( and using the exact material setup rich_is_bored proposes ), can you try that as well ?

 

Regarding the scale() thing, it's a ( very hacky ) way to flip the normalmap Z component by setting the blue channel of the normalmap image to 0.

Because the normalmap RGB values are brought from their 0-255 ( 0.0 - 1.0 ) range into the -1.0 - 1.0 range in the interaction shader, a blue channel value of 0 ends up being converted to a -1.0 Z value.

 

Edit :

Turning the func_static inline ( setting "inline" "1" on the entity and then compiling the map ) seems to help, but not sure if that is what you want - and it might not work well with Seed since it's being turned into map geometry.

Link to comment
Share on other sites

Thank you for the explanation. I'll retry Rich's setup, and also take a closer look at the model, I've been having a rough time with smoothing groups when working with imported models and who knows, maybe they could be influencing the results.

Link to comment
Share on other sites

Rebb - thanks a lot for putting this shader together, it really helped me as I was a bit lost there. :) I couldnt put the shader provided by Rich to work with the model, but I was wondering about the second blend diffuse map in yours, for the back; it lists the same image as the front one. It is said in the original thread that they should be different, otherwise you wont get to notice the transparency? I did pointed at a different image, but I just wanted to check because if possible we could save in file size and work just by using the same diffuse.

Here's some info from polycount on how to make the second diffuse texture:

http://wiki.polycount.com/NormalMap#Back_Lighting_Example

Link to comment
Share on other sites

Here's some info from polycount on how to make the second diffuse texture:

http://wiki.polycoun...ighting_Example

 

Thank you, that was exactly the page I remembered but couldn't find it. The explanations there are very good and easy to understand.

"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

Its no use, the back faces are still darker than usual, I was thinking it had something to do with smoothing, but the front faces seem to light up without issues, so it should be the same for the back face, right? Here's the shader I came up with:

 

textures/custom/bush01tdm
{
surftype15
description "foliage"
qer_editorimage textures/custom/bush01tdm_ed
nonsolid
twosided
noshadows
{
 blend bumpmap
 map textures/custom/bush01tdm_local // the front normal
 vertexcolor
}
{
 blend diffusemap
 alphatest 0.5
 map textures/custom/bush01tdm // the front diffuse
 vertexcolor
}
{
 if ( parm11 > 0 )
 blend gl_dst_color, gl_one
 map _white
 rgb 0.40 * parm11
 vertexcolor
}
{
 if ( parm11 > 0 )
 blend add
 map textures/custom/bush01tdm // the front diffuse
 rgb 0.15 * parm11
 vertexcolor
}

	// TDM Ambient Method Related
	{
			if (global5 == 1)
			blend add
			map					 textures/custom/bush01tdm // the front diffuse
			scale				   1, 1
			red					 global2
			green				   global3
			blue					global4
  }
{
 blend bumpmap
 map textures/custom/bush01tdm_localback // the back normal
 inversevertexcolor
}
{
 blend diffusemap
 map textures/custom/bush01tdm_back // the back diffuse
 inversevertexcolor
}
}

 

I created both the back diffuse and the back normal (inverting the blue channel and normalizing it with Nvidia filter), but no real difference. Also tried chaging the smoothing angle to 180º but saw no difference either (Im beginning to suspect Assimp might be doing things to the smoothing groups, a lot of my changes have no effect).

Edited by RPGista
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.


×
×
  • Create New...