Jump to content
The Dark Mod Forums

DR ASE Exporter: Vertical blending


Recommended Posts

Hello everyone.

 

I've just made some changes to the ASE exporter, and here are some results. All of this was created in DR using the script to export.

 

post-11230-0-36652900-1377532151_thumb.jpg

post-11230-0-14063600-1377532189_thumb.jpg

 

Here is the script used:

 

ase_export_blend.py.txt

 

The tunnels were textured with the following material shader:

 


textures/blendtest2
{  

{
 blend diffusemap
 map textures/darkmod/nature/grass/short_dry_grass_dark
 VertexColor
}

{
 blend diffusemap
 map textures/darkmod/stone/natural/lanrock1_d
 inverseVertexColor
}

}

 

The shader for the other texture looks similar. You may note that this shader only uses the diffusemap. This is due to testing purposes. Bump and specular can be added.

 

Once you start the script, there is a field were you can type in a number between 0 and 1. This tells the script at which height relatively to the overall height of the thing to export the blend should appear. 0 is at the bottom, 1 is at the top, 0.5 would mean in the middle etc...

 

The first texture (using VertexColor) is drawn below that line, while the other one (inverseVertexColor) is drawn above.

 

The broadness of the blending area basically depends on tesselation when using patches. I'll add a way to modify that later on.

  • Like 2

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

You have to build each side in vertical position and rotate the models later on or make sure that the area that should use one texture is higher then the one with the second texture. I'll provide scripts for more general cases in the next days.

post-11230-0-59654400-1377534023_thumb.jpg

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

Actually I didn't change very much in the script ;)

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

Well, one just need to download the file above and put it in the script folder.

 

You didn't change much, yet you give DR mappers the power of vertex blending!

 

Wizardry!

Actually you can manipulate the ase files manually in any text editor to achieve this effect. But thank you anyway.

 

As said, this is just a testing stage. I will try to enhance the possibilities of the script, but this may take some time (I hate python :angry: ).

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

You have to build each side in vertical position and rotate the models later on or make sure that the area that should use one texture is higher then the one with the second texture.

How would one go about doing this where I have my 3 patch based grass path sideways on, or is it eaisxer for me to wait for your "general" version of this script..?

Link to comment
Share on other sites

One possibility would be this:

post-11230-0-37450800-1377542029_thumb.png

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

OK.

 

Little update: I've managed to add some randomness. I'll have to change the way the data is stored in the script to get proper results, but this will wait til tomorrow. Tomorrow I'll also add a blend mode for roads. I'll upload the updated version tomorrow.

 

I'm not a houndret percent sure if I'll be able to generealize the script much. I have to dig deeper into python to see what I can do.

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

This is very cool but (to clarify) it still doesn't address the issue that Rich_is_Board mentioned.

 

What is happening here is an automation that takes map data and converts it to an ASE model.

 

ASE models have always supported Vertex blending it's just that no Doom 3 editor ever had the ability

to manipulate that data. You had to use Blender (etc).

 

Rich was discussing the idea of having native support for blends in the brush and patch structure of the

map itself.

 

One consequence of this type of workaround is that it increases the incentive to covert map geometry to ASE

models where possible. The downside, obviously, comes down to losing some freedom to optimize light count

and place portals.

 

Another approach to this problem that was discussed early in DR development (as I recall from reading the threads) is

the idea of baking new textures from overlapping alpha textures (etc) in essence making DR into a lite version of

Blender... this was rejected as it would cause every map to have unique texture assets and bloat the size of the mod.

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

The reason I asked is that this particular workflow looks awkward. Usually ASE meshes come from Blender/MAX/Maya, containing vertex colors. Why do that in DR, export to ASE and bring it back into DR is beyond me :)

 

This is in the nutshell how blending between textures can be handled in DR (but probably would need some engine / shaders intervention) http://www.simonoc.com/pages/articles/terrain1_4.htm (good old Quake 3 and q3map2)

 

Not as cool as painting inside the map editor, but at least would eliminate mandatory need to export from DR to ASE and import ASE back. Or one simple can learn how to paint vertex colors in Blender. It would be much easier than modeling ;)

 

P.S. I wonder why not to fix precision loss that corrupts maps and fix animation preview, before going into more tools (which is of course a good thing, but precision loss is a critical issue)

Link to comment
Share on other sites

There IS a benefit of making ASE in DR and re-importing.

Models eat memory only once. Each cloned brush/patch object eat their own amount of memory.

 

In principle, there will be a memory gain if the mapper uses ase-models in recurring objects, like windows. Also ase models are DR object corruption bug protected.

 

Yep, lots of benefits in ase models.WRT the precision bug in DR: if it was easy, it probably would have been fixed already. Probably no one knows how to fix it without generating other problems.

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

The precision *bug* was already decreased rather high. On a pc there are always precision errors.

 

Building on grid is a good way either to avoid this problem to a certain amount. Personally, I never had any problem with the shifting.

 

Everyone here does what he can. And if I am able to write a script that can allow mappers to create models with blended textures for their maps without them needing to learn to use a modelling program, I'll do that.

 

Not everyone has the time nor the interest in learning dozens of tools.

 

@Nbohr1more: Obviously it would be very cool and useful if mappers could apply the texture blend on patches and brushes in DR directly. It would be even more useful, if one hadn't to write a new shader definition for every single blend.

 

However, all of this needs a programmer who add those features to DR, test them and fix occuring bugs or interferences, and we are lacking a bit of such guis.

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

Obs, I agree. Simply wanting a cool feature doesn't mean that anyone around here will have the time or skill to build it. You're already in the 0.0001 percentile of the population if you can code anything much less a cool exporter feature like this. To have the feature Rich mentioned, we'd probably have to put up a bounty to attract a coder with the needed expertise.

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

I have found a general way for the script to work. I will optimize the code a bit, as it can take pretty long with lots of blends and will upload it here than.

post-11230-0-08633400-1377611021_thumb.jpg

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

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