Jump to content
The Dark Mod Forums

Recommended Posts

Posted

OK, I was able to finish the script. For it's usage, you need two things.

 

The script (obiously ;) ): ase_export_blend.py.txt

 

This material file: blendtexture.mtr.txt

 

The texture defined in the latter is textures/common/blend. It uses the caulk editor image as I didn't replaced that, but it does not behave like caulk. You only need it to apply the blending effect. It does not get exported and don't need to be shipped with your FMS that use those models.

 

As explained earlier, blending textures consist out of two textures, where the first one is marked with VertexColor and the second one is marked with inverseVertexColor. It could be vice versa, too. But for reference let's assume it is like that.

 

To apply the blending effect, you just need to texture the appropiate parts of the later model with your blending textures. Then create some brushes textured with the blend texture and place them in a way, that all vertices that should use the second texture are included in those brushes.

 

Note that vertices are not neccessarely the same on patches as what you can select in DR. The amount of vertices a patch has, depends on the tesselation. Every corner point of a triangle is a vertex.

 

Note also that the script takes the AABB, the axis-aligned bounding box into consideration for checking whether or not a vertex is inside those brushes. So don't rotate them.

 

Once you are going to export your brushes/patches as a model, make sure that the blend-textured brushes are selected, too.

 

I will post some examples in this thread so you can see how to use it.

 

Enjoy! :)

  • Like 3

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

Posted

Sounds great. I guess after some people used it and give some feedback we can decide upon that. :) (Who knows which bugs I missed)

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

Posted

Thats freaking lovely, this guy is a genious!

 

Did not quite get it how you picked the textures you blended together, but I love the results and the fact its all done one the go, inside DR. Amazing work.

Posted

Yeah, the quality is not really good. Sorry. The blue texture is the shader that can be seen in game later, the pink one is common/blend.

 

@RPGista:

textures/blendtest
{
{
 blend diffusemap
 map textures/darkmod/plaster/plaster_01
 VertexColor
}
{
 blend diffusemap
 map textures/darkmod/stone/brick/blocks_brown
 inverseVertexColor
}


}

That's the shader for the room. No bump or specular as it's just for testing, though. All vertices inside the pink box use the scond texture, while the other ones use the first one. Between those the texture gets blended.

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

Posted

OK. Here comes a little step by step explanation of how to use the script. For an example I am going to create a pond. It should use a mud earth texture in the middle and a dry earth one on the borders.

 

The textures I've choosen are:

  • darkmod/nature/dirt/dry_dirt_01 post-11230-0-31346400-1377624903.jpg
  • darkmod/nature/dirt/dry_earth_muddy post-11230-0-28504700-1377624910.jpg

In DR the texture for common/blend looks like this: post-11230-0-40708500-1377625031.jpg

 

The first thing to do is writing the material file. It looks like this

textures/mud_blend
{

 qer_editorimage textures/blend/mud_blend
 surftype15
 description "dirt vine_friendly"

{
 blend diffusemap
 map textures/darkmod/nature/dirt/dry_dirt01
 VertexColor
}
{
 blend diffusemap
 map textures/darkmod/nature/dirt/dry_earth_muddy
 inverseVertexColor
}

}

 

textures/blend/mud_blend is this image: post-11230-0-89843100-1377625937.jpg

 

Now first I have to create my pond. I create a cylinder patch and invert it. Than I drag the upper vertices outside and the lower ones downside to create a nice little cone:

 

post-11230-0-32155000-1377626022_thumb.jpgpost-11230-0-78321100-1377626126_thumb.jpg

 

Some more vertice movement and I have my pond shape (very roughly here, but it's just for explanation ;) ):

 

post-11230-0-45098000-1377626195_thumb.jpg

 

--- to be continued ---

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

Posted

After that I project the mud_blend textore on the patch from above:

 

post-11230-0-16007500-1377626290_thumb.jpg

 

Now I have to define which parts should use the second texture. For this purpose I use brushes textured with common/blend.

 

post-11230-0-31666800-1377626343_thumb.jpg

 

After I'm done with that I can check if the tesselation of the patch is fine enough for my needs, then select everything and start the script:

 

post-11230-0-51774000-1377626429_thumb.jpg

 

I've used the name pond here. After the script ran through, I reload the models and find my pond in the model browser:

 

post-11230-0-63473800-1377626486_thumb.jpg

 

--- to be continued ---

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

Posted

And this is how it looks in-game:

 

post-11230-0-59987900-1377626587_thumb.jpg

 

Note that due to the very simple shader definition the textures look a bit odd here. If you take a look at the shaders of the two original textures, you can see that there is some more magic done with the images, and bump- and specular maps are added as well. This can be done here, too, of course.

 

I hope this tutorial is understandable and that mappers will have a lot of fun using this tool to create good looking missions.

 

If there are questions left, just ask. Please report any bugs or errors that may occour.

 

Sincerly, your Obsttorte :)

  • Like 1

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

  • 4 weeks later...
Posted

Its exported as an .ase right? So changing it after importing it again isn't going to happen. It needs to be the way you want it prior to exporting.

 

We can't edit models in DR as I understand it.

Posted

Have you considered adding further blendmaterials like "blend 50%", "blend 33%", "blend 66%" etc. so that the vertex color assignment is not binary?

Posted

I have thought about this, but currently I'm thinking it would make things only more complicated (at least for me, as I would have to implement it ;) ). I'm still hoping that there may be a more intuitive way of doing this.

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

Posted

Well, the most intuitive way would obviously be to write a plugin that allows for actual grayscale painting of vertices of ASE models. But that'd be a whole lot of work... ^^

 

I would have thought extending the script with further blend materials would boil down to basically a simple switch-statement:

If (material == blend50)
  currentVertex.Color = .5;
elseif (material == blend33)
  currentVertex.Color = .33;
....

 

Ok, now that I think about it, you would also have to handle overlapping brushes with different blend textures etc. Ok, that's indeed getting more complicated...

Posted

As this works best with patches, a simple way of creating a similar effect is to change the vertex positions. This also changes the tris and the way the texture gets blended. You can already do quite a lot with that.

 

In addition, the ase files can be manipulated per hand afterwards. Not very intuitive but I guess this is basically for people who want to have it look perfect.

 

The absolute end goal would be to add vertex coloring support to the game engine and alow to manipulate this via DR. But this is definetely a whole load of work. :(

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

Posted

Ok I have tried to follow this thread but Im egtting nowhere and the blurry vids were practically impossible to follow.

 

@Obs, can you have a look at my test map and tell me where I am going wrong..?

 

-skydrive

Posted

I have a limited up-/download amount.

 

That's why I've added a tutorial based on pictures :)

 

I may upload a tutorial video next month.

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

Posted

@Bikerdude:

 

Your materials folder is called matrials, which I guess is part of the problem. The script does not have to be shipped with the pk4, it is only used by DR to create the model. The latter must be shipped with the pk4.

 

The script must be placed under scripts/commands/ in your DR install folder.

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

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

    • HEX_OX12

      ai have information and ai want to sell them
      · 1 reply
    • jivo

      I just uploaded a new version of the Visible Player Hands mod. It's been updated for TDM 2.13 and has new animations. Check out the post if you're interested!
      · 0 replies
    • datiswous

      I moved from Manjaro Linux (rolling release) to Linux Mint (LTS). One of the reasons was that I found the updates a bit too often and long. But now on Mint I get updates every day, although they're usually small updates.
      · 3 replies
    • JackFarmer

      "Hidden Hands: Vitalic Fever" - new update available including subtitles & compressed briefing video (thanks to @datiswous) and several fixes.
      · 0 replies
    • Wolfmond

      🇬🇧

      2025-04-20
      I'd like to track my level design progress a bit more often now, so I'm using the feed in my profile here.
      I've been working intensively on Springheel's YouTube course over the past few days. I'm currently up to lesson 8. There is so much information that needs to be processed and practiced. 
      I have started to create my own house. As I don't have the imagination to create a good floor plan, I grabbed a floor plan generator from Watabou and experimented with it. I chose a floor plan that I will modify slightly, but at least I now have an initial idea. 
      I used two guards as a measuring tape: The rooms are two guards high. It turned out that I can simply double the number of boxes in DarkRadiant in grid size 8 that are drawn in the floor plan. 
      I practiced the simplest things on the floor plan first. Drawing walls, cutting walls, inserting doors, cutting out frames, creating VisPortals, furnishing rooms.
      I have had my first success in creating a book. Creating a book was easier than I thought. I have a few ideas with books. The level I'm creating will be more or less a chill level, just for me, where I'll try out a few things. I don't have an idea for my own mission yet. I want to start small first.
      For the cellar, I wanted to have a second entrance, which should be on the outside. I'm fascinated by these basement doors from the USA, I think they're called Bilco basement doors. They are very unusual in Germany, but this type of access is sometimes used for deliveries to restaurants etc., where barrels can be rolled or lifted into the cellar. 
      I used two Hatch Doors, but they got completely disoriented after turning. I have since got them reasonably tamed. It's not perfect, but it's acceptable. 
      In the cellar today I experimented with a trap door that leads to a shaft system. The rooms aren't practically finished yet, but I want to continue working on the floor plan for now. I'll be starting on the upper floor very soon.

      __________________________________________________________________________________
      🇩🇪

      2025-04-20

      Ich möchte nun mal öfters ein bisschen meinen Werdegang beim Leveldesign tracken, dazu nutze ich hier den Feed in meinem Profil.
      Ich habe mich in den vergangenen Tagen intensiv mit dem Youtube-Kurs von Springheel beschäftigt. Aktuell bin ich bis zu Lektion 8 gekommen. Das sind so viele Informationen, die erstmal verarbeitet werden wollen und trainiert werden wollen. 

      Ich habe mich daran gemacht, ein eigenes Haus zu erstellen. Da mir die Fantasie fehlt, einen guten Raumplan zu erstellen, habe ich mir einen Grundrissgenerator von Watabou geschnappt und damit experimentiert. Ich habe mich für einen Grundriss entschieden, den ich noch leicht abwandeln werde, aber zumindest habe ich nun eine erste Idee. 

      Als Maßband habe ich zwei Wächter genommen: Die Räume sind zwei Wächter hoch. Es hat sich herausgestellt, dass ich in DarkRadiant in Gittergröße 8 einfach die doppelte Anzahl an Kästchen übernehmen kann, die im Grundriss eingezeichnet sind. 

      Ich habe bei dem Grundriss erstmal die einfachsten Sachen geübt. Wände ziehen, Wände zerschneiden, Türen einsetzen, Zargen herausschneiden, VisPortals erstellen, Räume einrichten.

      Ich habe erste Erfolge mit einem Buch gehabt. Das Erstellen eines Buchs ging leichter als gedacht. Ich habe ein paar Ideen mit Bücher. Das Level, das ich gerade erstelle, wird mehr oder weniger ein Chill-Level, einfach nur für mich, bei dem ich ein paar Sachen ausprobieren werde. Ich habe noch keine Idee für eine eigene Mission. Ich möchte erst einmal klein anfangen.

      Beim Keller wollte ich gerne einen zweiten Zugang haben, der sich außen befinden soll. Mich faszinieren diese Kellertüren aus den USA, Bilco basement doors heißen die, glaube ich. Diese sind in Deutschland sehr unüblich, diese Art von Zugängen gibt es aber manchmal zur Anlieferung bei Restaurants etc., wo Fässer dann in den Keller gerollt oder gehoben werden können. 
      Ich habe zwei Hatch Doors verwendet, die allerdings nach dem Drehen vollkommen aus dem Ruder liefen. Inzwischen habe ich sie einigermaßen gebändigt bekommen. Es ist nicht perfekt, aber annehmbar. 
      Im Keller habe ich heute mit einer Falltür experimentiert, die zu einem Schachtsystem führt. Die Räume sind noch quasi nicht eingerichtet, aber ich möchte erstmal am Grundriss weiterarbeiten. In Kürze fange ich das Obergeschoss an.



      · 2 replies
×
×
  • Create New...