Jump to content
The Dark Mod Forums

Epi's Many Questions Thread


Epifire

Recommended Posts

After popping messages to many of the folks around here for various things, I decided to delegate a single thread for my various probs and proposals. Therefore avoiding the many threads I would end up creating, for a lot of the ideas and art questions as I dive into TDM more.

 

So the first one up that sorta hit me as I was editing tonight in Dark Radiant was terrain. Now I'm fairly impressed with what the patch system can do but I have concerns with blending textures. Currently as far as I can tell, decals are limited only to actual brushes (not patches). And secondly, patches from my knowledge don't have any kind of paint mode. So I guess my other option would be modeled terrain, which actually seems easier for me. Only thing is if id 4 actually supports the method I want to use, which is vertex painting.

 

I'm assuming that you can edit vertex colors and that they're probably preserved in the engine. But what I'm wondering is if the engine supports multiple textures being painted onto the same mesh? For painted terrain and so forth. Part of me feels like you should be able to assign three different texture layers in the shader via RGB colors, (which would be awesome!) because then I could have grass, dirt and gravel properly blending on the same mesh. I know that's something I would be able to do with Unreal, and in Source you could just paint onto displacements. So now I'm just trying to figure out the best method for accomplishing that in TDM. Many thanks in advance!

Modeler galore & co-authors literally everything

 

 

Link to comment
Share on other sites

So the first one up that sorta hit me as I was editing tonight in Dark Radiant was terrain. Now I'm fairly impressed with what the patch system can do but I have concerns with blending textures. Currently as far as I can tell, decals are limited only to actual brushes (not patches).

You can make a decal patch for your terrain manually, by duplicating the patch then trimming away the parts you don't need. There's a patch splitter script I made for DR that makes that job easy. It's not part of the official DR distribution but you can assign the script to a hotkey in DR and the instructions are here: http://forums.thedarkmod.com/topic/16090-patch-splitting-in-dark-radiant-new-version-29-mar/?p=340549

 

I'm assuming that you can edit vertex colors and that they're probably preserved in the engine. But what I'm wondering is if the engine supports multiple textures being painted onto the same mesh? For painted terrain and so forth.

The engine supports vertex colouring, but for two textures only. Their contributions will always sum to 1. The first texture's colour is multipled by the vertex colour, and the second texture's colour is multiplied by one-minus-the-vertex-colour. It's good for blending two textures on a model, basically.

 

DR doesn't have any support for vertex painting. Obsttorte came up with a method for letting people do this to terrain in DR by using brushes to mark the places where the second rextures shows up (iirc). http://forums.thedarkmod.com/topic/15026-dr-ase-blend-exporter/?do=findComment&comment=318475

 

NB the version of Obs' script that's packaged with DR isn't the latest / correct version. The latest is linked in that thread. As a modeller though, I expect you'd always reach for your modelling program for that task.

 

Part of me feels like you should be able to assign three different texture layers in the shader via RGB colors, (which would be awesome!) because then I could have grass, dirt and gravel properly blending on the same mesh. I know that's something I would be able to do with Unreal, and in Source you could just paint onto displacements. So now I'm just trying to figure out the best method for accomplishing that in TDM. Many thanks in advance!

I agree that would be awesome, and it might not even need any engine changes. It could be possible with a tweaked interaction shader, that a modeller could package with their map. The problem would be the workflow. Without a lot of DR changes, could mappers take advantage of it? You can split your mesh to get a 3-texture blend in the meantime, although not with all 3 textures on the same spot.

  • Like 2
Link to comment
Share on other sites

You can make a decal patch for your terrain manually, by duplicating the patch then trimming away the parts you don't need. There's a patch splitter script I made for DR that makes that job easy. It's not part of the official DR distribution but you can assign the script to a hotkey in DR and the instructions are here: http://forums.thedarkmod.com/topic/16090-patch-splitting-in-dark-radiant-new-version-29-mar/?p=340549

 

Ah that sounds really useful. Since you're layering the existing patch with an identical one I think the projection should be pretty accurate too. Even if I didn't implement terrain with patches in the future, I could still see myself making use of that for roads and small select areas.

 

 

The engine supports vertex colouring, but for two textures only. Their contributions will always sum to 1. The first texture's colour is multipled by the vertex colour, and the second texture's colour is multiplied by one-minus-the-vertex-colour. It's good for blending two textures on a model, basically.

 

 

Two textures is very doable actually. I for anything with more to add or blend I could just separate the meshes into sections. Do you know of any documentation regarding how this is setup for the shader? If I can get a template to work from I have a map I'm dabbling with that I could test this in right away in.

 

I agree that would be awesome, and it might not even need any engine changes. It could be possible with a tweaked interaction shader, that a modeller could package with their map. The problem would be the workflow. Without a lot of DR changes, could mappers take advantage of it? You can split your mesh to get a 3-texture blend in the meantime, although not with all 3 textures on the same spot.

 

For me it would be incredibly helpful (but that's also because I basically live in XSI). The workflow is such that I would setup my main boundaries in DR and export them. Once loaded into XSI, I'd make my terrain and then it would be exported to fit in exactly that spot in the map. The control would be phenomenal, but exclusive to be used per instance. So it wouldn't be something you'd really want to upload into community content as it wouldn't make much sense to use outside of the map it was created for. As long as the shaders would be setup right, there wouldn't really be any additional file sizes to worry about since you're basically just customizing blend options for tiling textures.

 

I have some very grand ideas on how this could really make a scene pop, since an area I'm focusing on is a rundown building close to the sea. I'm taking a very different mapping approach since I want to try and get away from a lot of the city assets and start something fresh in a more rural abandoned level. The terrain is really important to be convincing since that will be the glue to what's holding a lot of it together, with far less buildings that is.

Modeler galore & co-authors literally everything

 

 

Link to comment
Share on other sites

I have some very grand ideas on how this could really make a scene pop, since an area I'm focusing on is a rundown building close to the sea. I'm taking a very different mapping approach since I want to try and get away from a lot of the city assets and start something fresh in a more rural abandoned level. The terrain is really important to be convincing since that will be the glue to what's holding a lot of it together, with far less buildings that is.

 

I like this idea, it would be great to have work done on a more organic way, a more complex outdoors landscape, less orthogonal architecture...

Link to comment
Share on other sites

 

I like this idea, it would be great to have work done on a more organic way, a more complex outdoors landscape, less orthogonal architecture...

 

Well the big trick is how well the lighting and visibility is managed. I'm trying to figure out what's good for blocking and making walls with, and not being overly obvious with it.

 

Though I do really want to find out more how I might setup this painted shader, one other thing has sorta been nagging me with outdoors and that's moonlight. For some reason I thought we already had some kind of ortho/planar light setup, for that but I'm not finding it? The stuff I try and setup is kinda faulty because since it requires a cone for directional light, and requires a high room ceiling. I mean a map could certainly do without and just try to direct the player with more point lights, but it would just be interesting to be able to simulate decent moonlighting in an complete outdoor scenario.

Edited by Epifire

Modeler galore & co-authors literally everything

 

 

Link to comment
Share on other sites

Two textures is very doable actually. I for anything with more to add or blend I could just separate the meshes into sections. Do you know of any documentation regarding how this is setup for the shader? If I can get a template to work from I have a map I'm dabbling with that I could test this in right away in.

Here's an example of what the material should look like. For "yourChosenDRpath" you specify where you want to find it in DR's media tree. If you want to find it easily in a top level "Epi" folder, use "Epi".

 

None of this is case-sensitive.

 

 

textures/yourChosenDRpath/name_of_material
{
    surftype15
    description "blended textures X and Y"

    
    // First texture, texture_X.tga (or dds)
    
    bumpmap     textures/custom/texture_X_local   // path to the normal image file
    
    // Optional specular stage for first texture
    {
        blend specularmap
        map textures/custom/texture_X_s                   
        VertexColor
    }
    
    {
        blend diffusemap                                                    
        map textures/custom/texture_X             // path to diffuse TGA or DDS
        VertexColor                                                         
    }

    // TDM Ambient Method Related
    {         
          if (global5 == 1)
          blend add   
          map    textures/custom/texture_X       
          scale 1,1                                                         
          red    global2
          green   global3
          blue   global4
          VertexColor
    }

    
    // Second texture, texture_Y.tga (or dds)
    
    bumpmap     textures/custom/texture_Y_local   // path to the normal image file
    
    // Optional specular stage for second texture
    {
        blend specularmap
        map textures/custom/texture_Y_s                   
        inverseVertexColor
    }
    
    {
        blend diffusemap                                                    
        map textures/custom/texture_Y             // path to diffuse TGA or DDS
        inverseVertexColor                                                      
    }

    // TDM Ambient Method Related
    {         
          if (global5 == 1)
          blend add   
          map    textures/custom/texture_Y       
          scale 1,1                                                         
          red    global2
          green   global3
          blue   global4
          inverseVertexColor
    }
}

 

 

 

moonlight

We have parallel lights. Select a light in DR, hit 'L' to bring up the light inspector, and there's a "parallel" checkbox. You set the direction NOT by rotating the light, but by pressing V to enter vertex editing mode, then moving the light vertex.

 

The bad news: Parallel lights are fiddly and glitchy. If you try to stretch them across too many visleafs, you'll get shadow errors or areas where they vanish.

The good news: Once you've got them working right, they are stable. So it's not a deal breaker.

 

They look ugly if you can see the edge of the light volume. That should be in an unreachable part of the map.

 

If you need a parallel light to stretch across many visleafs, you are better off using several and making sure there are indoor or covered regions between visleafs to hide the edge of the light. It doesn;t have to be "indoor". A natural arch of rock would do. That's not a bad idea anyway to be honest: Don't plan for huge open areas with no pinch points in TDM, it's not what our portalled engine was designed for. Feel free to dazzle us with the illusions of space that you can create though :)

 

I did some experiments with moonlight as my first ever experiment with TDM and DR. I ended up finding an overly complex method of making moonlight work through unlimited visportals and map size (although it would have a perf hit so don't think of doing this on a very large map with loads of outdoor AI). If you are interested see this thread: http://forums.thedarkmod.com/topic/16046-dynamic-moonlight/

 

Random tip: The forum search facility is pretty useless, especially with our tendency to bury loads of information in umbrella threads, and the wiki search isn't great either. To search both sites well, use google instead, with a search like this:

site:thedarkmod.com blend vertexcolor
  • Like 1
Link to comment
Share on other sites

Alright so after a long week I'm back at it to see how I can get this blend stuff working. So far it looks like it's loading the correct material, but I think either my vertex painting or my material (or both?) are at fault. Seeing here in this sorta dark shot, you can still see the oddly stretched textures on separate triangles...

 

requiem_2015-08-14_02.49.14_zpspuonr8mk.

 

Both cubes are triangulated but have different paint methods. One has the top half painted white and the bottom black. The other uses an actual color instead of white. Both are facing the same origin, and you can see that somehow alters this stretching effect with different paints added. Although no actual blending is occurring. Here is the material shader I'm using...

 

 

 

terrain_blend_001
{
surftype15
description "blended textures X and Y"


// First texture, generic_grass_001 (or dds)

// bumpmap textures/terrain/generic_grass_001_local

// Optional specular stage for first texture

{
blend diffusemap
map textures/terrain/generic_grass_001 // path to diffuse TGA or DDS
VertexColor
}

// TDM Ambient Method Related
{
if (global5 == 1)
blend add
map textures/terrain/generic_grass_001
scale 1,1
red global2
green global3
blue global4
VertexColor
}


// Second texture, generic_soil_001 (or dds)

// bumpmap textures/terrain/generic_soil_001_local

// Optional specular stage for second texture

{
blend diffusemap
map textures/terrain/generic_soil_001 // path to diffuse TGA or DDS
inverseVertexColor
}

// TDM Ambient Method Related
{
if (global5 == 1)
blend add
map textures/terrain/generic_soil_001
scale 1,1
red global2
green global3
blue global4
inverseVertexColor
}
}

 

 

 

It's a little sloppy as I just was trying to get it working to test it in the middle of the night here. I may have missed something kind of important though too. Like I wasn't sure if the VertexColor/inverseVertexColor line was needed to be changed to something more specific to the actual color I'm defining. It's a start though, and at least it's running the material (at least halfway).

Modeler galore & co-authors literally everything

 

 

Link to comment
Share on other sites

The material looks ok except that you have no bumpmap. You do need a bumpmap in a material to activate the light interaction drawing. Just use

bumpmap _flat
for each stage if you don't want / have a real bumpmap. I'm not sure what bit of code is painting those cubes right now, but if you add a bumpmap it'll make sure it's the right bit.

 

The stretching looks like your UVs are messed up. I take it they look ok in the modelling program? The engine occasionally generates its own UVs (texgens) but it shouldn't be doing that in your material. There's a slight chance that the lack of a bumpmap is making some other part of the code that uses texgens kick into action... but that's a long shot.

Link to comment
Share on other sites

Whoa, did NOT see those moonlight expriments, SteveL my friend! Incredible and fantastic. :) I believe I was the first guy to use parallel moonlight in a TDM map, so this has a nice nostalgia feel for me. Your setup woulda really come in handy back then. Are you planning on using it for your map, please do. ;)

 

As for the issue of parallel lights, I remember I wasnt able to put it work for a while, untill I came across Katsbits tutorial about them and he had a downloadable light entity that I simply imported in my map and that worked. Dont remember why I couldnt make it work manually.

  • Like 1
Link to comment
Share on other sites

Alright gonna take another stab at this (why the heck I never have time during the day is beyond me!). Did a bit of looking around and there seems to be a very informative article over at katsbits in regards to this... http://www.katsbits.com/tutorials/idtech/vertex-texture-blending-applied-to-models.php

 

Down towards the bottom of the page I'm reading something that kinda explains this problem more...

Corrupt, Wonkey Or Stretched Textures. A UVW map problem to do with the distribution of the texture over the polygons the mesh is constructed from. Usually means reediting the UVW map on the model to correct any distortions.

My guess is that maybe there is a partial shade of something else on the mesh. But this page clarifies parts of what would otherwise be completely unexplained steps to this blending method. Definitely saved, bookmarked and maybe even something worth etching in stone as there's a ton of valuable info on this. Still though, the fact that there's still no blending going on in-game still makes me think there's something wrong with the mtr. Gonna strip it of anything unnecessary and start from there.

Modeler galore & co-authors literally everything

 

 

Link to comment
Share on other sites

Feel free to PM me your test map with any materials + models needed if it's not working. Your material looks ok except for the bumpmap, and no you don't change the [inverse]vertexcolor keywords. I don't know about modfelling, but I do have a debug build of the engine and should hopefully be able to see why it's not blending.

Link to comment
Share on other sites

  • 2 weeks later...

Alright, trying not to get too hung up on one thing right now, though it would be lovely if I could find what was wrong with those blend textures. I did send a PM your way SteveL, not sure if you ever checked that since it had been a while. Anywho, tryin something really different here for an intro video to a new project I'm working on with a friend. Basically it sets up a mission in the old fashion way, with shots of the level or even additional art for previous areas that setup the story. What I'm also doing is I'm painting over shots I'm taking from in-game shots off these (story rooms) to give them that recalled from memory "paintery look". Current one being a conversation overheard at a local pub.

 

Okay so for the questions on this one. I'm trying to get the shot as close to the end goal as possible (so that I wont have to manually paint it in). And the only thing that's getting me now is NPCs. Being that I have no idea how to script them, other then checking off patrol mode and making them sit down. I would like to be able to find out how to control the direction the NPCs are looking (with their head not just their body) and what animation they're using. In Hammer we had a special entity to control animated sequences, but I'm not sure what something like that would take in DR. For look direction we'd simply add a target entity in the world and send a command to the NPC to look at it.

 

The main NPCs I want more control over are two NPCs that are supposed to look like they're talking to eachother at a table, and a player Thief character sitting at an opposite angle that's turning his head to listen off in their direction (all inconspicuous like). I could probably get by with just the common anims that play ordinarily and just wait for the thief character to turn his head for the shot, but it wouldn't be near as convincing.

Modeler galore & co-authors literally everything

 

 

Link to comment
Share on other sites

There are pathnodes that can control which direction AI look, I believe, though I've never used them.

 

path_lookat

This does not stop the AI, but they will turn their head and look somewhere specific as they walk to their next target. For the next wait seconds, turn head to look at the entity given by the focus spawnarg (defaults to looking at the path_lookat entity itself). This is useful if you want to make sure an AI is looking at a specific spot (or away from a certain spot) during their patrol. Note the focus entity must not be obscured by monsterclip.

Link to comment
Share on other sites

I agree that would be awesome, and it might not even need any engine changes. It could be possible with a tweaked interaction shader, that a modeller could package with their map. The problem would be the workflow. Without a lot of DR changes, could mappers take advantage of it? You can split your mesh to get a 3-texture blend in the meantime, although not with all 3 textures on the same spot.

 

SteveL how hard would it be to create support on TDM for Texture splatting? Just curious.

 

http://www.gamasutra.com/blogs/AndreyMishkinis/20130716/196339/Advanced_Terrain_Texture_Splatting.php

 

 

This could be of interest also

 

http://www.gamedev.net/blog/73/entry-1682713-terrain-texturing/

Edited by HMart
Link to comment
Share on other sites

  • 3 months later...

Back to one of my many questions! So I'm about to start texturing my arc transformer here shortly in Substance Painter and it starts with a calibration for engine type. The D3 engine is based off of OpenGL right? If so that's really all I need to know. My current setup is based for working in Unreal Engine 4 which runs with DirectX. Not sure what all the difference is on the texture but I'm trying to see what all I can do in Substance for an older (non-PBR) engine type.

  • Like 1

Modeler galore & co-authors literally everything

 

 

Link to comment
Share on other sites

  • 2 weeks later...

Random question for the day.

 

What is the general consensus on an in-depth animated clock? I've seen stuff with the Source engine that's driven by code to throttle an animation. Basically you'd setup the clock hands and set the position based by timer.

 

So a second hand would have 60 frames and the code would run it through that animation based off of a coded timer to run it. I'm not asking someone to build it, I'm moreless asking what it would take to make it in the technical aspect. It's simple in theory but I have absolutely no idea what this looks like from a coding aspect.

  • Like 1

Modeler galore & co-authors literally everything

 

 

Link to comment
Share on other sites

What is the general consensus on an in-depth animated clock? I've seen stuff with the Source engine that's driven by code to throttle an animation. Basically you'd setup the clock hands and set the position based by timer.

 

 

We already have clock hands that keep accurate time, but they're decals rather than models. I imagine the same thing could be achieved with models without the need for an actual animation.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

Welp time for my next question. Been finalizing more meshes recently and something has been bothering me some. And that is shadow meshes. For some reason I can't parent, merge or include the shadow mesh in any kind of way with my export lwo file. It's a Softimage problem I feel but it's one nonetheless. Collision seems to work fine but when using the listed lines (and texture resource) to add a shadow material, it just comes up missing in-game. Is there a separate way to call up a shadow mesh? Usually my more detailed meshes sit around 4-8k polys and I doubt that's efficient usage of id4's dynamic shadowing.

 

I had heard there was a way of adding a shadow mesh in some roundabout fashion (besides embedding it within the detail mesh). Any ideas or suggestions would be fabulous. I seem to have noticeable performance hits when I get several of my models in the same room. I'm feeling that's the reason.

  • Like 1

Modeler galore & co-authors literally everything

 

 

Link to comment
Share on other sites

I'll try that. Also what are the official keynames for the shadow's material to be named? It may just be a faulty name I used too (which would be an easy fix).

 

I haven't made a shadowmesh just by itself but I can look into that too.

Modeler galore & co-authors literally everything

 

 

Link to comment
Share on other sites

it's "common/texture/noshadow"

 

Though I don't know why the name of the texture would have much effect on whether it saves or not.

Link to comment
Share on other sites

it's "common/texture/noshadow"

 

Though I don't know why the name of the texture would have much effect on whether it saves or not.

 

Oh no I meant the material definition. Because (at least I thought) the material name assigned to the model was important for calling up the correct shader. I hadn't any clue about the actual texture, but the name applied to the model I figured was a big deal. Is noshadow what the material needs to call up then? I had been using just been naming my material shadow, assuming that was what the shadow meshes used.

 

EDIT: Great news! Found out it was a naming issue in Softimage's material naming system. The material, "common/texture/shadow" gets underscores due to the fact that Soft' replaces any \ | / symbols with an underscore. So basically it was improperly named. Made a separate mesh of pure shadow material and it rendered out beautiful in-game. So looks like I'm off to optimizing my current meshes now! B)

Edited by Epifire
  • Like 1

Modeler galore & co-authors literally everything

 

 

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

    • Petike the Taffer  »  DeTeEff

      I've updated the articles for your FMs and your author category at the wiki. Your newer nickname (DeTeEff) now comes first, and the one in parentheses is your older nickname (Fieldmedic). Just to avoid confusing people who played your FMs years ago and remember your older nickname. I've added a wiki article for your latest FM, Who Watches the Watcher?, as part of my current updating efforts. Unless I overlooked something, you have five different FMs so far.
      · 0 replies
    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 4 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
×
×
  • Create New...