World Machine Community

Sharing => Works in Progress => Topic started by: WFab on March 24, 2014, 01:13:45 PM

Title: Texturing in world machine
Post by: WFab on March 24, 2014, 01:13:45 PM
Hi, I'm currently working on a terrain texture for a client, and although it was to be done in game engine, I tried to do it in world machine (diffuse only). So far looks ok, despite the fact that terrain is 2k where textures are 1k. Gonna use knald to extract normalmaps and ao maps later. Please be brutally critical while commenting! :P

P.s: Textures only, terrain is just a test!
Title: Re: Texturing in world machine
Post by: WFab on March 25, 2014, 11:44:57 AM
After layering a few more mediocre textures on the rock, with some perlin and voronoi patterns combined.
Title: Re: Texturing in world machine
Post by: Remnant on March 25, 2014, 02:37:15 PM
Nice attempt so far. If you were able to crank the texture resolution up I bet you could really make things shine.

A few things that I notice:

Texture transitions: particularly sand<->rock, would benefit from a hard edged transition rather than a smooth blend. try adding a noise function to the transition, or if you have a heightfield you're using for your rock, use the height value of the rock to raise the top areas of rock out of the sand, so that in the transition zone the sand just settles into the cracks.
Title: Re: Texturing in world machine
Post by: Onkelpoe on March 26, 2014, 02:12:09 AM
This starts to look really good !!! Wow!

Texture transitions: particularly sand<->rock, would benefit from a hard edged transition rather than a smooth blend. try adding a noise function to the transition, or if you have a heightfield you're using for your rock, use the height value of the rock to raise the top areas of rock out of the sand, so that in the transition zone the sand just settles into the cracks.

This is, what I try to archieve somehow - but does not work out right...

Can you explain, how one can "use a height value of the rock .to raise top areas of rock out of the sand..." ???


Cheers!
Title: Re: Texturing in world machine
Post by: WFab on March 26, 2014, 02:32:47 AM
@Remnant : As paul already said, I tried settling the sand in the cracks using the deposition map from erosion. Seems like the terrain should be at least 4k for that to look right, whereas I have to deliver not more than 2k maps, and possibly less than that. File textures need to be hi res for the proper megatexture like texturing, then maybe we can dial down on resolution. I may try it on some personal projects though, as this seems an exciting angle to explore. As for cranking up the textures, I don't have a very good texture library, nor do I know of many sites to download Hi resolution textures. I am a purely procedural guy, I build my own textures in vue or filter forge, although It would be too much work for a small project like this. Could you point me to a good site where I can find some Hi res textures in Creative commons domain? 

@onkelpoe : Thanks, but I must mention, I got this idea from you!
Title: Re: Texturing in world machine
Post by: WFab on March 26, 2014, 02:34:36 AM
P.S I didn't understand what you mean by height value of rocks either. Could you please elaborate on that?
Title: Re: Texturing in world machine
Post by: Onkelpoe on March 26, 2014, 02:46:44 AM
heheh, no problem Pratyaksh ;)

Can you explain or show the settings,  how you got this nice sand and "greens" variations?
Looks quiete good

Best Regards,

Paul
Title: Re: Texturing in world machine
Post by: WFab on March 26, 2014, 02:55:02 AM
@paul : Greens is a texture filter from filter forge 3 called Moss maybe. Sand is a free texture known as whitesand, I modified it in world machine for some color. Settings I cannot show, as I don't have the permission to do that from the client. Although once this is done, I might make a project of my own, to test this method's limits! Then I will probably post all settings here!
Title: Re: Texturing in world machine
Post by: Onkelpoe on March 26, 2014, 03:00:02 AM
Would be awesome, thanks a lot

Cheers!
Title: Re: Texturing in world machine
Post by: Remnant on March 26, 2014, 02:16:17 PM
This starts to look really good !!! Wow!

Texture transitions: particularly sand<->rock, would benefit from a hard edged transition rather than a smooth blend. try adding a noise function to the transition, or if you have a heightfield you're using for your rock, use the height value of the rock to raise the top areas of rock out of the sand, so that in the transition zone the sand just settles into the cracks.

This is, what I try to archieve somehow - but does not work out right...

Can you explain, how one can "use a height value of the rock .to raise top areas of rock out of the sand..." ???

Cheers!

Sure. This is actually a pretty cool topic that deserves its own post -- but I'll throw this inline for now.

I'm talking principally about when using either external textures or procedural textures that are not intricately linked to the terrain surface -- for example, a rock texture, or a grass texture. Check out the following world and image to show what I mean. I took some time this morning to create and encapsulate all the blending bits into a macro -- which I need to make public, as this is a classic kind of scenario where a macro is useful.

But essentially, the macro modifies your chooser mask so that the relatively-higher texture is favored. This means that if you are blending a rock and grass, the rocks will stick out of the grass appropriately, but also that grass can grow between the rocks if the grass is high enough. In the example world its just showing how to blend textures, and so is using a simple linear gradient transition and no underlying heightfield, but obviously you can use this in conjunction with height/slope selectors, etc to assist in texturing from your world.

It's a simple but powerful technique that improves the blend quality tremendously!
Title: Re: Texturing in world machine
Post by: WFab on March 27, 2014, 01:31:56 AM
I tried this method this morning, but the major problem in my case is low res textures, and of course I need them to be perfectly tiled. Thanks for the macro though! Is it for just two textures? So we have to make a cascading device arrangement for more than 2 textures? Or am I mistaken, and this macro supports more inputs? I'm not currently able to open it, since I'm using an older build 2.3. I understand the principle though, so thanks for that!
Title: Re: Texturing in world machine
Post by: Remnant on March 27, 2014, 01:39:21 AM
The macro above is just for two textures... although after the fact, I realized that the effect is very similar to what you can get by instead (ab)using a Splat Converter device set to "Favor best match" with a high priority value -- this is a lot easier than the above macro and works for as many textures as you want. There are some slight differences from the macro I provided, but for ease of use its the way to go.
Title: Re: Texturing in world machine
Post by: WFab on March 27, 2014, 02:00:14 AM
I never used Splat converter' favour best match. It's inputs and outputs only support heightfields don't they?
Title: Re: Texturing in world machine
Post by: Remnant on March 27, 2014, 11:03:27 AM
yep -- but again, you're only modifying the chooser mask control input, not the textures themselves!
Title: Re: Texturing in world machine
Post by: Onkelpoe on March 28, 2014, 01:27:04 AM
I try to get the macro working in my project, but I still fail...
Got no heightfields, but "bitmap" instead. In the macro, there is a hint like "make heightfield from color"... how to do this?

In my project, I got some mountain textured with photo and some color generators, some "forest" areas and sand.
I worked with colorizers and selectors to texture it all.

But I cant see a way to involve the macros here... I really would like to seperate the mountains from the forest and sand, because
right now, all three areas are blended smoothly into each other...


@Pratyaksh

What are your world-parameters/extent to resolution ratios?
Is it 8x8km at 2k res?

Cheers!
Title: Re: Texturing in world machine
Post by: WFab on March 28, 2014, 03:15:33 AM
Hi paul,
It's a little less than 20kms, at 2k. I would have loved to get it at 4k or more, but client's request was to keep it below 2k.
Could you post some screens from your project, as well as device network, so I can suggest some solutions to your prob?

Title: Re: Texturing in world machine
Post by: Onkelpoe on March 28, 2014, 06:02:21 AM
Hey Pratyaksh,

very kind! thanks for your help, once again!

So here ais my setup and a detail shot from the transition, that I want to drive with that new macro, provided by the author of this cool piece of software

Basically, I want to seperate the green from the rock ;)

Cheers!
Title: Re: Texturing in world machine
Post by: Remnant on March 28, 2014, 11:11:04 AM
Ok, that picture is helpful!

So basically, what we have to do is create a separate "height" or "strength" heightfield for each color layer we want to use the enhanced blending for. To get the same effect as described above, these height channels should be considered the "local" heightfield for a texture; that is, its not describe the macro-scale height of the terrain, but the micro-scale (cracks in rocks, etc).

So for example:

1) if we want to consider the grass to be "always flat", and the rocks to be lumpy, we could assign a constant generator as the micro-scale height of the grass.
2) We can build a microscale height for the rock textures out of the brightness value of the texture -- add a channel splitter set to HSB mode to your rock texture to get the brightness of the texture.
3) It looks like the chooser just inside the red box on the right side is the chooser that is blending your rock and grass textures, correct? If so, then insert the new macro inline on the C "chooser mask" input for that chooser.
4) Then connect your relative microheights for textures A and B that we created in steps 1 and 2 to the height inputs of the macro.

Your chooser mask should now have been modified to make the rocks stick out above the grass.  Play with the macro settings to perfect.
Title: Re: Texturing in world machine
Post by: Onkelpoe on March 31, 2014, 01:12:56 AM
Hey Stephen,

thanks for helping once again!

Ok, I setup the channel-splitter and connected the macro-output to the "C"-control input of the chooser, that combines the grass/forest and rocks.

I am not sure about the "constant generator" - how to combine this one with all the nodes? Is it ok, like I did?
(Please see my current setup)



Best Regards
Title: Re: Texturing in world machine
Post by: Remnant on March 31, 2014, 04:13:36 PM
The constant generator doesn't need to be connected to the combiner above it -- in fact, if the constant generator is producing a constant value of zero, it will essentially erase whatever the combiner there is doing. It can just go directly into the texture height input of the assistant macro.


I've been exploring this technique more extensively myself lately too. I've got several other examples ready to go that I'm pretty sure will do a better job of being easy/understandable than the above macro -- I'll try to get them out soon.
Title: Re: Texturing in world machine
Post by: Onkelpoe on April 01, 2014, 11:47:38 PM
The constant generator doesn't need to be connected to the combiner above it -- in fact, if the constant generator is producing a constant value of zero, it will essentially erase whatever the combiner there is doing. It can just go directly into the texture height input of the assistant macro.

hmmm, when I do so, I get strange effects on my terrain...
If I set the constant to about 3000m and connect again with chooser mask, like in the image above - it is looking much better.

Ok, Ill looking forward to the macros, you mentioned.

Thanks for this great support youre doing!

Cheers!

Title: Re: Texturing in world machine
Post by: Onkelpoe on April 08, 2014, 02:49:44 AM
I am experiencing kind of trouble with texture-images.

When creating an island with a 100x100km extent, applied photo-textures look good-ok from like 50km away - but when zoom in, things getting ugly very quick.
When creating an island with a 10x10km extent, photo-textures are still good when zoomed closer - but the island itself... seems it can not be shaped very much.
Basically, its just "one big rock", instead of a rocky-island, you know?!

Lets take the "islnad" example, that ships with WM - you can get a nice shaped, interesting island.
But when try to texture it, results are not satisfying. everything gets just too blurry...
When changeing the extent to 10 times smaller (from 100km to 10km) with keeping a 2K res, the textures looking good - but the island is just one big "blob"

Any ideas, how to overcome this?
Or is it just a "You can have one or the other - but not both" thing?

See, Id like to have an interesting shaped Island (lets say like a dragons head) AND have cripsy textures on it at the same time...

So maybe one have to take a side-route here? Like use a splatmap to assign some textures within another app and then put together
a nicediffuse-bitmap in there?!

Kind Regards
Title: Re: Texturing in world machine
Post by: Onkelpoe on April 13, 2014, 11:03:37 PM
No ideas? So it will not be possible? Thats a pity...
Title: Re: Texturing in world machine
Post by: Remnant on April 14, 2014, 12:00:24 AM
If you are reducing the size of the world, you just need to reduce the feature size as well to compensate -- so it taking a island from 100x100 to 10x10, if you want to get the same kinds of features scale the noise function feature size by 1/10 and also the layout break scale the same amount

cheers
Title: Re: Texturing in world machine
Post by: Onkelpoe on April 14, 2014, 12:06:20 AM
hmmm, I tried exactly that - but it does not work out right... Ill give it another shot, then!

Cheers
Title: Re: Texturing in world machine
Post by: Onkelpoe on April 14, 2014, 12:12:19 AM
So all this values have to be reduced to 1/10, do i understood this right?

Kind regards
Title: Re: Texturing in world machine
Post by: Onkelpoe on April 14, 2014, 12:23:30 AM
Scaled everything in Island Shape and Perlin Mask to 1/10 - and scaled extent down to 10x10km (from 100x100km)
Scaled my Island-shape&perlinmask to fit into the 10x10km extent.
Now nearly everything is gone/there is just a little "sand-dune" left.

(I have set feature-size and transformation to 1/10 of the original value in the lowland/mountain noises)

If I would only manage to get this right, it would be really really awesome !!!

Cheers!
Title: Re: Texturing in world machine
Post by: Remnant on April 14, 2014, 12:54:32 AM
the full list of things to rescale to keep the exact same feel at 10x smaller scale would include:

world extents
world vertical extents
generator feature size
layout shape falloff scale
layout generator breakup amount and scale

Doing so should get you more or less the exact same island, for example.

But after saying all the above, I should also say that if your purpose in doing this rescaling is ONLY to get less blurry textures, I don't think you will achieve what you want -- for a given detail scale (shown in your world extents dialog, for example "13.5m per pixel", you will get the same results no matter what size your world extents are. So if you reduce the world extents and build at the same size, you will indeed get more detail -- but that's because you're covering less area. There's no way to get a free lunch!

 if you need higher resolution textures on a large area, you will need to do one or both of these things:

1) Build at a higher final resolution (make the detail scale finer)
2) Use higher-resolution input textures
3) Make the texture tile more frequently by increasing the world size of the texture.
Title: Re: Texturing in world machine
Post by: Onkelpoe on April 14, 2014, 02:40:41 AM
thanks for reply, Ill try it now!

by "world vertical extents" - do you mean "general setup - Quick adjust vertical scale" ?

the full list of things to rescale to keep the exact same feel at 10x smaller scale would include:

world extents
world vertical extents
generator feature size
layout shape falloff scale
layout generator breakup amount and scale

Doing so should get you more or less the exact same island, for example.

But after saying all the above, I should also say that if your purpose in doing this rescaling is ONLY to get less blurry textures, I don't think you will achieve what you want -- for a given detail scale (shown in your world extents dialog, for example "13.5m per pixel", you will get the same results no matter what size your world extents are. So if you reduce the world extents and build at the same size, you will indeed get more detail -- but that's because you're covering less area. There's no way to get a free lunch!

 if you need higher resolution textures on a large area, you will need to do one or both of these things:

1) Build at a higher final resolution (make the detail scale finer)
2) Use higher-resolution input textures
3) Make the texture tile more frequently by increasing the world size of the texture.

I do not understand right, I guess. I want to re-scale the 100kmx100km extent to 10x10km, because I want textures to be not so blurry.
(that is my only reason to do it) When making the texture tile more frequently - it doest not really get better, even at the lowest stetting of about 500m.

(edit: sorry, my mistake. Only making the texture tile more frequently is not enough, like you stated - I also had to up the resolution, then it is getting better!)

When detail-slider is set to 2048x2048 for 100 by 100 km extent, I get a detail scale of 48.828m/pixel.

My textures are 2048x2048 and 1024x1024 resolution only.
So, when re-size this extent to 10 by 10 km and keep the 2048 resolution, I get a detail scale of 4.883m/pixel.


"100km_extent_zoom_far_out" looks great, but "100km_extent_zoom_in" doest not.
"10km_extent_zoom_far_out" look great, "10km_extent_zoom_in" still does "ok"
Basically, I want the cliff texture in "100km_extent_zoom_in" to look like "10km_extent_zoom_in" (please compare the attachments)

So- maybe I try set the detail-res to 8K and see, if that gives a better result.

edit2: Calculating an 100x100km extent with 8k res seems like a solution - texture is getting sharper now.
But I have to try some more...

If somebody knows how I could get the desired results (see images above) another way, Id be happy if it is getting posted here...

Best Regards
Title: Re: Texturing in world machine
Post by: WFab on April 15, 2014, 01:52:17 AM
I'm having a similar problem. When I tile a low res (1k) texture about 4 times, I should get better details in 4k builds. But it seems like blending option in tiling is causing the blurring problem in the whole texture. I'm using a 20km square terrain. will post the screenshot as soon as the build is done.
Title: Re: Texturing in world machine
Post by: Onkelpoe on April 15, 2014, 02:01:21 AM
Hey, how are you?! Everything good?

have made kind of progress - right now, I am testing a few things.
I reduced the extent from 100km to 50km and up the resolution from 2k to 4k. Now, I reduce the extent further down to 25km and res 4k, then I do a 8k test.

I want to check out, if 1/4 of the original extent (25 instead of 100km) and going from 2k to 4k detail-res would be better, than leaving extent at 100km and go up to 8k res, which takes significant more time...


Cheers!


edit: I think, I let it be for now - Ill take the large-extent-with-8k-res-route, until a better solution comes up. I feel like Iam hitting a wall in WM-texturing right now. So I will test one last thing - texturing in another app with a splatmap serving as guide.

Did your build finished? ;)
Title: Re: Texturing in world machine
Post by: WFab on April 15, 2014, 02:19:05 PM
Hi Paul! Yes everything's good  :)

The build finished, but it seems like there is more work to be done within the engine itself if you want a decent looking texturing on your game terrain. For example in unity, I think marmoset skyshop is a good package to buy, because of it's image based lighting tools and terrain shaders. The shading system can provide the desired small scale details. I wish we could do it in world machine, as I like the interface and freedom, but texture stretching is unavoidable, along with some other missing tools. Here's my screen btw...
Title: Re: Texturing in world machine
Post by: Onkelpoe on April 15, 2014, 11:21:24 PM
Yap, youre right!
WM seems to be a bit limited for "AAA texture-tasks" on larger extents (>10km) - it does create terrains and that it does very very well.
For base texture, I will keep the 100km extent and go for 8k detail-res, then re-scale the texture to 4k for use in unity.
That way it will be kind of "ok" when not zoomed in too close.

So yeah, other tools come into play here, like skyshop for unity or maybe dedicated texturing apps (Ill try one today).


You got the grass very well, really like that! (I did a mix of 2 grass textures btw)

Cheers!
Title: Re: Texturing in world machine
Post by: Remnant on April 16, 2014, 12:46:32 AM
It does strike me from this conversation that knowing the "output detail scale" (detail scale of the file input / localspace object once inserted into the terrain) is very useful and should be automatically reported, especially if you are trying to figure out how high-res you should be building your world at. Until then you can calculate this yourself. For example, using some of the numbers posted earlier:

If you have a photo texture input of 1k resolution, and you set the file input size slider to have the texture repeat every 5km, your texture detail scale is 5000m / 1024px = 4.9m/px. So if you are building a 20km x 20km zone, to capture the full detail of your texture you should be building at at least a 4096x4096 world (20km / 4096 = 4.8m/px)

If this is not reflecting the full quality of your input texture, can you post an example for me to take a look at?
Title: Re: Texturing in world machine
Post by: Onkelpoe on April 16, 2014, 02:49:05 AM
Hey Stephen, thank you for this information :)

Let me see, if I can get this right:

1024px texture at 3km tiling = 2.9m/px
Extent= 100x100km

100km/4096 detail resolution = 100/4096*1000 = 24.4m/px

So to capture the full detail of a 1024x1024 texure projected at 3km tiling onto a 100kmx100km world, I would have to set a
detail resolution of at least 32768 - correct?

(100/32768*1000 = 3.0m/px)

edit: But that would mean, one could lower the texture res to 256px to get a sharper projection?
        When extent, detail-res and tiling are the same, a 256px texture should be choosen over a 2048px one?

Best regards!
Title: Re: Texturing in world machine
Post by: Remnant on April 16, 2014, 01:53:29 PM
Yup, your calculation is correct with regards to the size of terrain you'd need.

This is also why you noticed things being sharper in a smaller world : The resolution available in the build is stretched over much less area, and so is more detailed (for example, a 4k resolution world at 10x10km = 2.4m/px! This is reported in the World Extents dialog where you setup your world.)

Regarding your edit: In a way yes, but not usefully.

Here's what I mean: if you used a 256x256 texture dropping into the same scenario as before, your texture scale would be 3km / 256 = 11m/px. To achieve "perfect" texture reproduction you would thus need at least a 9k world resolution (100km / 9000 = 11m/px).

But remember what "perfect" means : simply matching your texture. You reduced the resolution of your texture, and the target target resolution is now 11m/px instead of 3m/px -- ~4x less detailed than if you used a 1024px texture. You could have achieved the same result by using the 1024px texture and just building at a smaller resolution! All other things equal, always use the highest res textures you can -- it will never hurt and it can help.
Title: Re: Texturing in world machine
Post by: Onkelpoe on April 16, 2014, 02:06:15 PM
Thanks for clarify it :)

Ok, my "best try" today was 1024 res @ 8K detail (100km extent) - was kind of "ok". I also tried to reduce the extent to 50km (50%) and down to 10km (10%) and also re-sized "vertical scale", "fall off" (sland-shape and perlin-shape), "size-value" of the two perlin noises acordingly...

The texture was super-sweet - but I could not manage to keep the terrain "feeling" from the 100km extent intact, unfortunatly... this would have been killer ;)

Cheers!