Jump to content


Photo

DR ASE Blend Exporter


  • Please log in to reply
77 replies to this topic

#1 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPip
  • 4922 posts

Posted 27 August 2013 - 10:25 AM

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

The script (obiously ;) ): Attached File  ase_export_blend.py.txt   18.14KB   33 downloads

This material file: Attached File  blendtexture.mtr.txt   211bytes   20 downloads

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! :)
  • jaxa, nbohr1more and SteveL like 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
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#2 greebo

greebo

    Heroic Coder

  • Root
  • 15921 posts

Posted 27 August 2013 - 10:29 AM

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

#3 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPip
  • 4922 posts

Posted 27 August 2013 - 10:51 AM

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
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#4 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPip
  • 4922 posts

Posted 27 August 2013 - 10:55 AM

Some example videos:




  • RPGista likes 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
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#5 RPGista

RPGista

    Advanced Member

  • Member
  • PipPipPip
  • 1378 posts

Posted 27 August 2013 - 11:03 AM

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.

#6 grayman

grayman

    Master Builder, Coder

  • Active Developer
  • PipPipPipPipPip
  • 11622 posts

Posted 27 August 2013 - 11:36 AM

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.

#7 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPip
  • 4922 posts

Posted 27 August 2013 - 11:40 AM

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
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#8 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPip
  • 4922 posts

Posted 27 August 2013 - 12:56 PM

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:
In DR the texture for common/blend looks like this: Attached File  blend.jpg   4.14KB   1 downloads

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: Attached File  mud_blend.jpg   35.66KB   1 downloads

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:

Attached File  tut1.jpg   278.49KB   1 downloadsAttached File  tut3.jpg   261.88KB   1 downloads

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

Attached File  tut4.jpg   282.05KB   1 downloads

--- 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
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#9 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPip
  • 4922 posts

Posted 27 August 2013 - 01:02 PM

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

Attached File  tut5.jpg   228.11KB   1 downloads

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

Attached File  tut6.jpg   227.57KB   2 downloads

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:

Attached File  tut8.jpg   308.29KB   4 downloads

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

Attached File  tut9.jpg   173.45KB   3 downloads

--- 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
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#10 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPip
  • 4922 posts

Posted 27 August 2013 - 01:05 PM

And this is how it looks in-game:

Attached File  tut0.jpg   190.68KB   6 downloads

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 :)
  • Bikerdude and Sotha like 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
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#11 Bikerdude

Bikerdude

    Mod hero

  • Member
  • PipPipPipPipPip
  • 18360 posts

Posted 27 August 2013 - 07:10 PM

And this is how it looks in-game, Sincerly, your Obsttorte :)

Chocolate starfish!

#12 Bikerdude

Bikerdude

    Mod hero

  • Member
  • PipPipPipPipPip
  • 18360 posts

Posted 24 September 2013 - 04:09 PM

Some example videos:

Once the the blend is done, is the mapper then free to flatten out the patches..?

#13 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPip
  • 4922 posts

Posted 24 September 2013 - 11:46 PM

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
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#14 Bikerdude

Bikerdude

    Mod hero

  • Member
  • PipPipPipPipPip
  • 18360 posts

Posted 25 September 2013 - 04:56 AM

I will have a go at replicating my question in DR and then come back here if I still need help.

#15 Lux

Lux

    Advanced Member

  • Member
  • PipPipPip
  • 1575 posts

Posted 25 September 2013 - 05:45 AM

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.

#16 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPip
  • 4922 posts

Posted 25 September 2013 - 08:30 AM

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
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#17 Lux

Lux

    Advanced Member

  • Member
  • PipPipPip
  • 1575 posts

Posted 25 September 2013 - 11:05 AM

Thanks for clarifying, Obsttorte.

#18 STiFU

STiFU

    Uber member

  • Development Role
  • PipPipPipPip
  • 3122 posts

Posted 26 September 2013 - 04:59 AM

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

#19 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPip
  • 4922 posts

Posted 26 September 2013 - 05:31 AM

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
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#20 STiFU

STiFU

    Uber member

  • Development Role
  • PipPipPipPip
  • 3122 posts

Posted 26 September 2013 - 05:56 AM

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

#21 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPip
  • 4922 posts

Posted 26 September 2013 - 06:51 AM

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
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#22 Bikerdude

Bikerdude

    Mod hero

  • Member
  • PipPipPipPipPip
  • 18360 posts

Posted 26 September 2013 - 08:40 AM

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

#23 New Horizon

New Horizon

    Mod hero

  • Active Developer
  • PipPipPipPipPip
  • 13731 posts

Posted 26 September 2013 - 08:58 AM

Indeed, how come the videos are only 360p max?

#24 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPip
  • 4922 posts

Posted 26 September 2013 - 09:17 AM

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
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#25 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPip
  • 4922 posts

Posted 26 September 2013 - 09:20 AM

@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
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users