Re: terrain ?

gamemaker wrote:

So Ayulin, you are saying that to save memory I should try using 512 textures, and making the stencils inbetween each texture 1024, correct ?

thx
Gm

Hey there..

Well I used those numbers as an example of the process itself; how you can work with 2 or 3 smaller tilable images and then blend them with a blend map.

The size for the blend map depends on how fine of detail you want in the texture blending. The more space you have in the blend map, the sharper and more "fine" the transitions can be, and in a smaller amount of space.

The the actual textures themselves, 512x512 is a nice image size if you're using a pattern that you want to repeat a lot (like a tiled floor, a generic ground/grass texture, etc) while maintaining enough variation so it doesn't look *too* repetitive. If you're using something that you want less repetition in, it might be better to use a somewhat larger image size... 1024x1024 might fit that perfectly. It all depends on your needs and what you need each individual texture/tile to do. I believe the dirt texture I'm using in my shot, with the small plants, is 512x512, and I'm able to get a nice degree of variation in there so you really don't see much of a recognizable pattern when it's tiled over a large area - that has a lot to do with how the texture is created, though.

As you work with that method and see the results, you'll get a feel for what you can get away with in terms of what size your textures and blendmaps are.  "Horses for courses", as the saying goes.

Last edited by Ayulin (2013-04-09 20:27:14)

Re: terrain ?

I will certainly give that a try. My island.blend has horrid stretching on one side of it, and I do not think I can fix it without redoing the texture work. Sad but true wink

I'll definitely give the stencil map in-betweens a shot and see if it helps.

Thx for all that wink

cheers
Gm

Re: terrain ?

So, now that I'm ready to begin learning all this texture blending stuff, I'm looking through this thread at the various posts and, I have to admit, it's all going right over my head. I see numerous different examples of different scripts, some called "frag" some called "vert", but I don't know which I'm supposed to use, or if I should use both?

I also see some written for what seems like different combinations of texture layers, and I'm not sure which is which. I don't understand where in the script the textures are defined - or is that derived directly from the texture layer in Blender? It's all kind of confusing to someone like myself that's completely clueless in these things.

So, rather than trying to make heads or tails of all the different scripts posted here and what they're specifically doing, let me try something else... Please understand that posting a script and saying "here" is great, but if there's some kind of tutorial intended to show non-programmers how to set a model up with the correct texture settings, and with the correct GLSL code, that would be awesome. Providing the script is awesome, and quite generous.. but if I don't know what I'm looking at or where and how to use it, or what's doing what, it's all for naught.

The effect I would like to have is the ability to have, say, 4 texture layers, each with a normal map. So, in Blender it might look something like this:

Layer 1: Blend Map
Layer 2: Texture 1 (dirt, for example)
Layer 3: Normal Map 1 (for dirt texture)
Layer 4: Texture 2 (stone, for example)
Layer 5: Normal Map 2 (for stone texture)
Layer 6: Texture 3 (grass for example)
Layer 7: Normal Map 3 (for grass texture)
Layer 8: Texture 4 (second grass texture, for example)

Something like that...

What would I need to set up? Would I need one script, or two? Which types would I need to assign?

When would I use VertShad, FragShad, Z VertShad and Z FragShad?

Is there any basic instruction one what these are and what they're for?

I realize people have posted examples and such, but there's several different scripts, I'm not sure which situation I would use which script in, and none of it makes any sense to me. I've tried finding beginners' basic tutorials on GL Shader Language, but every one I've found assumes you're already familiar with Open GL Programming.. so it's clearly not a topic for "new programmers" to be able to pick up on easily... So, if there's just some basic instructions available somewhere saying "okay, you use this script to do "x", these specific parts control "y" and you'd apply it like "this" to accomplish "z"... that would be great. I don't know if such a thing can really be done, but well... can't hurt to ask, right? tongue

Thanks in advance smile

Last edited by Ayulin (2013-04-10 00:38:55)

Re: terrain ?

Sorry to continue to make this a tad confusing, but I seem to be atm. Using Maratis and setting up script is relatively easy, but getting those assets out of blender sometimes is challenging. I was using the simple texture painting method with only a uvmap and no stencil, but I understand that's limited texture wize and also eats up more ram, so that's not good.

I also need to clear up a mistunderstanding that I think is going in.

I commented on trying to be clear about something Ayulin was saying re: blendmap, and I mentioned 'is it a heightmap' in my response and he seemed to be indicating, that yes that's indeed it, but having gone back and verifying what was being said and the comments that followed, I think that's not the case.

It seems, as Anael eluded to, that the blendmap is what does the blending (glsl?), so I guess on this point Im confused, so could someone please enlighten me/us on 'how' to create this blendmap and what it takes to do that ? wink

I have googled, but Im finding absolutely nothing about it.

Thanks!
Gm

Re: terrain ?

gamemaker wrote:

Sorry to continue to make this a tad confusing, but I seem to be atm. Using Maratis and setting up script is relatively easy, but getting those assets out of blender sometimes is challenging. I was using the simple texture painting method with only a uvmap and no stencil, but I understand that's limited texture wize and also eats up more ram, so that's not good.

I also need to clear up a mistunderstanding that I think is going in.

I commented on trying to be clear about something Ayulin was saying re: blendmap, and I mentioned 'is it a heightmap' in my response and he seemed to be indicating, that yes that's indeed it, but having gone back and verifying what was being said and the comments that followed, I think that's not the case.

It seems, as Anael eluded to, that the blendmap is what does the blending (glsl?), so I guess on this point Im confused, so could someone please enlighten me/us on 'how' to create this blendmap and what it takes to do that ? wink

I have googled, but Im finding absolutely nothing about it.

Thanks!
Gm

Heheh no problem.

It's not a heightmap literally.

I understood what you were getting at, since both heightmaps and the stencil map look similar... black, white and shades of gray.

The difference is that in a heightmap, each pixel determines the height/elevation of its corresponding vertex in a terrain mesh. In a stencilmap each pixel determines the opacity of a texture at that point of the object it's applied to.

To help clear it up... don't think of it as a heightmap at all. Completely different purpose.

Think of it more like a Layer Mask in Photoshop or Gimp, where the black, white and gray pixels determine the opacity of part of an image.

There might be a bit of confusion using "blendmap" versus "stencil map".. So to clarify that, let's go with the following...

"Stencil Map" = the black, white and grayscale image used for the multitexturing method I've demonstrated in this thread.

"Blendmap" = the color map where R, G, B and such determines where and how textures are "blended" on an object's surface.

They're two completely different methods of doing the same thing, except that the color blendmap approach seems to give better control and is a bit more straight-forward to use (setup of the GLSL code notwithstanding).

Hopefully that helps lol.

Last edited by Ayulin (2013-04-10 04:44:08)

Re: terrain ?

So, just to follow-up on a previous post of mine (#53) where I was asking for some assistance on GLSL stuff, so I could understand more of what I'm doing when I'm using these scripts...

I continued looking up tutorials on Google for GL Shading Language and did finally find one that seems (so far, anyway) to be what I was looking for. So far it's been helpful for me with wrapping my brain around it. We'll see how I fare once I'm done with it tongue

Here's the site/page...
http://www.lighthouse3d.com/tutorials/g … -tutorial/

Maybe it'll help someone else as well.

Re: terrain ?

I was never in doubt, as to what a stencil map was, having worked with them extensively creating texture layers.

My question was 'how do you make a blendmap', and what they are, so I'm still looking for a answer on that one ( Ill google and try to find something, but so far nothing .

Thanks btw for the GL URL, as I think all of us 'non professional/hobby'  coders need a jumpstart like that.
We already had code from Anael ( others?, don't recall atm) in the form of the 2 shaders , and 'where' they go, but I think it's maybe semi cloudy as to how to adapt them for one's purpose maybe, so yes this URL with any luck ( haven't seen it yet) will give that needed HOWto info to those whom have never used GLSL before wink

Thanks for the detective work wink

So back to my initial question, what is this blendmap being discussed, and how do YOu create one inside blender for example ?

Gm

Re: terrain ?

anael wrote:

Another thing about using and playing with Maratis, the way the game plugin works, you have full access to the SDK (engine) in c++, you can use render to texture, draw triangles manually etc. If you really need a special feature, like LOD or adaptive terrain, if you have a developer in your team or if you are developer yourself, you can render terrain with your own code (using virtual MGame::draw()). So your game is having the feature you need, and you can then decide to share this code, to be included by default in the engine. that's why I'm saying the first thing to help is to try playing with it and doing game or demos.

I will try to make more examples to show how to use custom code inside a game plugin.

Thank you,
Anaël.

OUCH, I so totally missed reading this in your original post here Anael, so sorry about that.

That's what happens when you get busy and don't read everything <take time to do so>

That's great news...now there is no excuse to get busy and make that happen wink

Thx for that,and sorry I missed it initially.

Cheers
Gm

Re: terrain ?

I would say i would very much like to see terrain with heightmap\texture paint support in the engine as well as  brush support for making blocks. All the top game engines have these features, why should Maratis3d miss out on it? We can't all be blender experts. One thing i miss in this engine is a asset manager to easily browse assets.

Re: terrain ?

Hi Ireheart,

Anael has 'terrain' near the bottom of the list of priorities, because he is trying to produce better docs for Maratis as well as other important things, as you can see at the TODO list.

Many of us want a 'real' terrain system, but that won't happen anytime soon. I think Maratis started out as a simple engine for making quick small games, with a eye on mobile, given the increasing popularity of that market.

BUT, that's not to say, he would reject others creating that new terrain system, and incorporate it into Maratis.

This is open source, free software ( editor is GPL, engine ZLIB ) , so there is nothing holding back anyone from contributing . You can easily ( as noted by Anael) create  your own terrain system if you wish, for now, and use the virtual Mcore to interface it with Maratis.

Cheers
Gm