Topic: Multitexture/layers support?

Hello,

I'm posting this in hopes that maybe Maratis can be the solution I'm looking for in creating a prototype for a game project. I've spent so much time trying out different engines and all of them come up short. I'm hoping Maratis is the exception tongue

So, as I noted, I'm looking to create a prototype for a game project I've been working on. As it's a "microbudget" project, I'm relying on either very inexpensive or (ideally) free/source applications to make it work. I'm entirely "right-brained" and thus, work entirely in the creative side of things, although I do understand more technical stuff at a 10,000 foot level. I'm just lost if I try to actually do anything with them hands-on tongue.

So.. here's what I'm looking to do, and have been unable to in other engines so far.

I'm looking to create assets that support a system of multi-texturing, using multiple texture layers in a given material. It's difficult to explain, so I'll just show you a screenshot of my Blender layout that should illustrate what I'm after.

You'll notice that, in Blender anyway, the Maratis setup seems to handle it just fine. However, I don't know if that's Blender handling it, or if it means that Maratis can handle this. This is why I'm asking here tongue.

Here's the screenshot

Here's the specifics of this setup, so people know exactly what I'm trying to achieve...
1. I setup 2 basic, tilable textures, each assigned to a texture layer within the material (layers 1 and 3)
2. I create, or import, a 3rd image which acts as a "stencil map" to blend between the two color texture layers. (layer 2)
3. I create a UV channel to which the two color textures are assigned. This allows me to scale up the UVs of the object I'm texturing to adjust the tiling of the textures.
4. I create a second UV channel specifically for the stencil map, which is kept at a 1:1: scale. This becomes the basis for me to paint the stencil map and control the blending of the two texture layers.

The result is what you see in my linked screenshot.

My question is... Is this directly supported in Maratis? Will Maratis "know" how to handle those layers, the UV channels and the textures applied, to yield the same results as what's shown in that screenshot?

If it does, then Maratis will likely become my tool of choice for my prototype project.

I hope I explained that well, and thanks for any help/feedback!

Last edited by Ayulin (2013-04-07 19:21:00)

Re: Multitexture/layers support?

Hmm.. Looking through the documentation, it looks like Maratis doesn't actually support that. Well that's a bummer :-/.

Re: Multitexture/layers support?

Hi,

yes Maratis supports multi-texturing,
but there are limitations in the Blender exporter and Materials are simplified in 3 modes :
- Fixed (for old computer)
- Standard (for simple diffuse/spec/normalMap/emit)
- CustomShader (to do anything using shaders)

full doc here : http://www.maratis3d.org/?p=277

In your case, you can do this using the CustomShader mode and by writing a glsl shader.

The base of your fragment shader will be something like that :

uniform sampler2D Texture[8];
varying vec2 texCoord[3];
void main(void)
{
    vec4 texture0 = texture2D(Texture[0], texCoord[0]); // first textures (DirtGrass)           
    vec4 texture1 = texture2D(Texture[1], texCoord[1]); // second texture ("blend texture" or Stencil)
    vec4 texture2 = texture2D(Texture[2], texCoord[2]); // third texture (MossGrass)
   
    float interp = texture1.x; // use the red component of the "blend texture"
    float invInterp = 1.0 - interp;

    // interpolate the grass and moss textures
    gl_FragColor = texture0*invInterp + texture2*interp;
}

You can follow this topic about writing a shader for a terrain : http://forum.maratis3d.com/viewtopic.php?id=15

Re: Multitexture/layers support?

Ah, so it *is* possible then? Well that's good news!

I will have to look into that smile.

I'd moved on to use Torque3D since it's pretty

Re: Multitexture/layers support?

Just a note, I responded to your General > Terrain post, which applies here. Should really keep one thread going ,not several as it just serves to confuse things wink Anael is quick to respond to inquries which is always wonderful, but short of that, I am frequently ( because Im self employed and have the time)  on irc.freenode.net: #maratis . Please come join in wink

cheers
Gm