Jump to content
The Dark Mod Forums
Sign in to follow this  
Obsttorte

DR ASE Blend Exporter

Recommended Posts

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

WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Share this post


Link to post
Share on other sites

I can package that in the next release if you think this is ready for it.

Share this post


Link to post
Share on other sites

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

WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Share this post


Link to post
Share on other sites

Some example videos:

 

 

  • Like 1

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

WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Can't read any of the text in the videos; too blurry.

 

So can't really tell what's going on.

 

Perhaps a textual step-by-step would help.

Share this post


Link to post
Share on other sites

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

WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Share this post


Link to post
Share on other sites

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

WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Share this post


Link to post
Share on other sites

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

WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Share this post


Link to post
Share on other sites

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 2

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

WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Share this post


Link to post
Share on other sites

I don't understand the question.


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

WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

That's correct. All you can do is to create skins.


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

WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Share this post


Link to post
Share on other sites

@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

WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Share this post


Link to post
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.

Sign in to follow this  

×
×
  • Create New...