Jump to content
The Dark Mod Forums

RPGista's mapping and modeling thread


RPGista

Recommended Posts

Funny results, there's definitely something wrong with the shader, making the entity "inline" actually inverts everything about it:

 

shot00001gr.jpg

 

The right and the middle ones are "inline 1" entities, the texture now uses the back diffuse as the front one (I made the red leaves just to be able to really notice a change), and only responds to light coming from the back side of the polygons (see below).

 

 

 

 

shot00002pk.jpg

 

shot00003.jpg

 

The normal model (is not responding to light from the back)

 

shot00004j.jpg

 

shot00005t.jpg

 

 

 

Edited by RPGista
Link to comment
Share on other sites

"inline" is something you really shouldn't use (it basically turns a func_static or model into a worldspawn surface).

 

The "funny" results might be because a "twosided" material in D3 just results in every face getting duplicated and flipped during the loading time of the model. It might well be that "inline" does not even handle twosided materials and only includes the front side as a copy.

 

(Note about single-and twosided surfaces is that skins cannot change them. Once twosided, always twosided. Once onesided, always onesided. Normally this is not much of a concern but you cannot f.i. change a two-sided bush to use a one-sided texture with a skin change. Just wanted to throw that out here :)

"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

But I can see why Rebb suggested it, Inline works well in "normal" aplha texture models (without the translucency thing), it brightens them and gives it a global smoothing the gets rid of the backfaces - the only problem being that is gets a bit too bright in the darkness.

 

I gave up the whole thing and just went on working on the models and importing them, have 3 already working there. The 180º smoothing angle seems to be the best under the circunstances, and Im afraid without a good ambient level to light all faces, vegetation models simply dont look that good.

 

shot00002eo.jpg

 

shot00003rl.jpg

Link to comment
Share on other sites

If you want, you can use the method I used for the new plant models in 1.08.

 

 

 

textures/darkmod/nature/foliage/dry_brush_03

{

surftype15

description "foliage"

 

qer_editorimage textures/darkmod/nature/foliage/dry_brush03

 

noshadows

nonsolid

twosided

translucent

{

blend diffusemap

map textures/darkmod/nature/foliage/dry_brush03

alphatest 0.5

rotate 0.002 * sintable [ time * 0.1]

clamp

}

 

 

 

{

blend bumpmap

map textures/darkmod/nature/foliage/dry_brush03_local

rotate 0.002 * sintable [ time * 0.1]

 

}

 

{

blend add

rgb 0.1

map textures/darkmod/nature/foliage/dry_brush03

rotate 0.002 * sintable [ time * 0.1]

}

 

{

blend specularmap

map textures/darkmod/nature/foliage/dry_brush03_s

rotate 0.002 * sintable [ time * 0.1]

}

 

 

{

if ( parm11 > 0 )

blend gl_dst_color, gl_one

map _white

rgb 0.40 * parm11

}

{

if ( parm11 > 0 )

blend add

map textures/darkmod/nature/foliage/dry_brush03

rgb 0.15 * parm11

}

 

// TDM Ambient Method Related

{

if (global5 == 1)

blend add

map textures/darkmod/nature/foliage/dry_brush03

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/nature/foliage/dry_brush03_local // Bump

fragmentMap 2 textures/darkmod/nature/foliage/dry_brush03 // Diffuse

fragmentMap 3 textures/darkmod/nature/foliage/dry_brush03_s // Specular

}

}

 

 

I basically add a very subtle additive blend to the plant. It's enough to keep the faces from looking pitch black. Since most maps have ambient light, you don't really notice that all the faces are visible in pitch darkness. It's not ideal but it's the best compromise I could find.

Link to comment
Share on other sites

Awww.. you're doing plants for TDM?? I always wantet more different vegetation for the game - awesome! :D Please don't bury the "How-to" here if all works! I wanted to do some plants too, but don't have time at the moment. So when I get the time I wanna try that out too! :)

"Einen giftigen Trank aus Kräutern und Wurzeln für die närrischen Städter wollen wir brauen." - Text aus einem verlassenen Heidenlager

Link to comment
Share on other sites

If you want, you can use the method I used for the new plant models in 1.08.

 

I basically add a very subtle additive blend to the plant. It's enough to keep the faces from looking pitch black. Since most maps have ambient light, you don't really notice that all the faces are visible in pitch darkness. It's not ideal but it's the best compromise I could find.

 

Isn't there a way to add a subtle 0.1 of the same diffuse stage that is influenced by light? The frobhighlighting does something similiar, I think.

"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

Springheel - that shader really does help, the difference between lit and back face is a lot less noticeable now, I also like the animation! The only thing is, I can definitely see situations where you would want your vegetation to be in complete darkness with direct lighting control (like the dark woods in Winter Harvest, with its small pockets of lights), and unfortunately the shader makes them absolutely stand out below a certain ambient level. Should I provide both shaders with the models, for this particular case (the regular and the alpha blend one?)? Would it be possible to turn off the additive blend part from within DR, so there could be a comment pointing that out to mappers when you select the model? At the very least, I could create a wiki article with directions as to how to replace material shaders if you need to for your map (and provide both versions there).

 

ST - Sure, if you followed the conversation, Springheel's material shader should work great for most conventional situations, and there'll also be a regular material for when you need place them in dark environments.

 

Tesl - Would be perfect to have this shader setup responding to all darkness levels (even pitch black). Do you suggest it is possible?

Link to comment
Share on other sites

I suppose the material shader is set at spawntime, so you couldn't trigger a change of one in-game (if that's right), but even then you could have multiple objects with their own shaders and then switch out the objects.

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

Link to comment
Share on other sites

unfortunately the shader makes them absolutely stand out below a certain ambient level.

 

Yes, that's the downside. You could always include both shaders and mappers could switch to the other with a skin if they're using them in pitch-black areas. The name would have to be descriptive though.

 

Edit: I'm trying to find a solution for the updated skyrim hair for 1.09. It suffers from the same problem, and an additive blend is even less desirable there.

Link to comment
Share on other sites

Edit: I'm trying to find a solution for the updated skyrim hair for 1.09. It suffers from the same problem, and an additive blend is even less desirable there.

Haha this would look like Thief 3 then, wouldn't it? ^^

"Einen giftigen Trank aus Kräutern und Wurzeln für die närrischen Städter wollen wir brauen." - Text aus einem verlassenen Heidenlager

Link to comment
Share on other sites

Lazily looking for a reference to replace the matress model, I found a bunch of good (complete) ones that I thought could be quite useful to mappers (as we dont have that many available right now - and people could feel tempted to model their own bed structures); after some fixes, tweaks and optimizations (its now 788 tris), it's separated in 4 materials so I'll be looking into creating a few more skins for it, using stock textures only. Pillows might be a bit modern looking.

 

 

bed01e.jpg

Edited by RPGista
Link to comment
Share on other sites

Not this one, there's only that bit there of the mattress. I'll probably just have to model that by hand (this one was worth it because it just needed optimization and texturing). There's a king size one I'm also going to make TDM ready.

Edited by RPGista
Link to comment
Share on other sites

I got a problem that I can't seem to be able to shake, a really low poly table with good textures that I wanted to import, for some reason there is a consistent problem with the way it reacts to light in game - very dark, and will only be lit from certain angles, and even then, poorly. I read somewhere it could be a smoothing problem (Im pretty sure the material def and textures are ok), but I've tried every single option available and nothing seems to make a difference (even split the whole model, nada). Any clues, is it a common problem?

 

shot00001wl.jpg

 

you'll notice the candle doesnt lit the table at all.

Edited by RPGista
Link to comment
Share on other sites

It has to be the model and/or normals, I just _flat and _black the local and specular channels and even though the model was a lot brighter in game, it still doesnt answer to light correctly.

 

Here's the thing, if you guys want to take a look: http://www.sendspace.com/file/be3nuv

Link to comment
Share on other sites

The vertex-normals are all over the place, you can look at them if you do "r_showNormals 1" ( or another value, it sets the size of the visualization vectors ). Try setting smoothing groups or hard edges ( or whatever it's called in the 3d package of your choosing ) on the surfaces you want to be perfectly flat and then re-export the model.

 

If the vertex normals are messed up, then the tangent space is messed up, and all normalmaps use this to calculate lighting.

So even a "_flat" normalmap will look wrong.

Link to comment
Share on other sites

The model is fine as is. The vertex normals aren't all perfectly aligned but they're facing the correct direction so it's not a problem. Keep in mind that the normal map was baked in relation to how the vertex normals are currently positioned. If you do anything that might alter the vertex normals then you must also alter the normal map.

 

The true culprit here is the normal map. Invert the green channel of the image and it will look fine in game.

 

Invnorm.png

 

For future reference, when working with assets from various sources sometimes the green channel will need inverted. You can tell by looking at the image. If a raised area has green on top it needs to be inverted.

  • Like 1
Link to comment
Share on other sites

Inverting the green channel does help a bit with the top surface, but something is definitely strange with this model.

 

A placed candle looks fine on top but holding it below and to the sides shows some really weird shading - not something you would expect if the normalmap was properly baked with the exact same vertex-normals in place.

 

It looks like some have been changed afterwards, or the baking process went wrong somehow.

 

Maybe Xcen could provide his LWO model here too for comparison purposes ?

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

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 6 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
    • nbohr1more

      Looks like the "Reverse April Fools" releases were too well hidden. Darkfate still hasn't acknowledge all the new releases. Did you play any of the new April Fools missions?
      · 5 replies
×
×
  • Create New...