• entries
438
1182
• views
766346

# Texturing experiments

1185 views

So, lately I've been getting back into working on Goblinson Crusoe. I've got the core working again (except for particle systems), but I've allowed myself to be sidetracked. In my previous journal entry, I mentioned how I was working on a terrain editor. Well, in the editor I implemented the terrain texture splatting described here. And that work got me thinking about different ways of doing the ground and rocks in GC.

In the current GC, ground tiles and rocks are separate objects, complete with diffuse/normal maps. Standard. Repetition crops up because I reuse the same small set of objects all over the place, merely with different rotations. So I thought that maybe I could "borrow" the texture splatting from the terrain materials. And combine that with a tri-planar blended texture map for the rocks? These are my preliminary results of that experiment:

It's a quick experiment, a bit noisy-looking and nonsensical, but I think the idea is sound. The basis of the system is a texture atlas that holds 8 textures and a corresponding atlas for normals. The ground material uses 2 RGBA blend maps to blend between the 8 different terrain types in the atlas. In this case, I simply generate a noise fractal and blend between 2 textures on one layer, and select 2 textures on the other layer for the water tiles. The rock material is a tri-planar blend that uses the first blendmap for the ground textures (the one with the noise fractal) and uses the weights from that blend map to choose textures to apply in a tri-planar scheme.

The shaders are a tad heavy-weight, especially the tri-planar one. That one has 26 texture samples (1 weightmap, 1 object normal, 1 sample+normal for each of 4 terrain types per each of the 3 dimensions x, y and z). Even so, on my old Costco special box I get quite interactive framerates from this beast.

Whether or not I go through the gymnastics required to bring this scheme into GC proper, I still have yet to determine. Still, it gives me another potential tool in the toolbox, and it was kind of fun to work on anyway.

LOOKS GOOD

Awesome. Makes me want to get back into my game.

Heh, heh. Yeah. I don't have the debug console enabled at the moment, so the best I can say is "it's interactive." Doesn't feel too choppy. Kinda smooth, but sorta not smooth. Smooth-ish. At least in the neighborhood of playable, but I don't know if I can even say that considering all I'm drawing is the static terrain. Throw a few goblins in there, and who knows. Smooth-ish could turn into choppy-ish in a hurry.

Great work sofar :) Here are some thoughts:

The ground material uses 2 RGBA blend maps to blend between the 8 different terrain types in the atlas.

Just wanted to note, that with a default base map you have 9 different terrain types available.

The shaders are a tad heavy-weight, especially the tri-planar one. That one has 26 texture samples (1 weightmap, 1 object normal, 1 sample+normal for each of 4 terrain types per each of the 3 dimensions x, y and z). Even so, on my old Costco special box I get quite interactive framerates from this beast.

Looking at your basic tile shape , I could imagine a cylinder instead of a cube, this way a 2-planar blending could work too.

Instead of using
xy,xz,yz
as texture access try to use
xz
for the top and
wy
for the rest with
w = normalized angle of direction vector xz
something like this (mirrored at 180° for first test ;-) )
w = acos(dot(normalize(xz),vec2(1,0)))/PI



Wow Josh very nice work!!! Love this game and how it's coming along!! I wish I had more time to get back into coding again, hopefully soon!!!! Keep up the great work!

Yikes. Ashaman, pretend that accidental down vote was an upvote. Stupid tiny little Android screen, and stupid big fat fingers.

No problem :D I have my issues with these tiny smart phones too ;-)

Very nice!

Even so ... I get quite interactive framerates

That's a very PR-friendly way to phrase that.

Reporter: "So what's the typical framerate for the new game?"

Developer: "Uhm, it's a very... interactive... framerate. A framerate conducive to... interaction..."

The adjective you're looking for is "cinematic". Very cinematic JT!

WOW! I really like the rich colors!