Jump to content
The Dark Mod Forums

Texture blending model panels


Fidcal

Recommended Posts

No guarantee I'll continue with this as I don't know yet how practical it might be but thought it worth blogging progress and gettings suggestions, input from others.

 

Basically, texture blending doesn't work on brushes and patches but it does on models. If you know how to model you can make your own custom terrain but most mappers won't so I'm seeing if it is practical to make some generic models panels that can be overlaid, eg, over the edge of a grass/stone path, snow/cobbles, ash/fireplace, to soften the edges. The panels are just flat surfaces much like patches but they behave differently to patches so you cannot just adjust them to fit where you want; they are fixed models. My idea is to make a range of lengths and curves like a model railway that you join together and overly where needed. Also planned are heaps for dirt, ash, etc. You might even need to plan your path etc by laying these down first then making your brush/patchwork later. Dunno yet. I know nothing yet. ;) Once done, the mapper can easily duplicate the model(s) he wants and change the two textures to any pair that he wants so no need for thousands of combinations. They are also tiny files - 17K was this one)

 

This next test is to verify if I can get the model texture scale to match the terrain texture scale, and more importantly, get them to join seamlessly. The answer is yes. I'm using the compass image as a test because I can easily detect alignment and other errors. In the first image below you see in-game a brush set into the floor with the compass texture set at default 0.5 scale 'natural'. Laid upon it is a model test panel with the same texture and scale. You might think you can see the join but that is a glitch in my model and the actual model edge is invisible - it merges seamlessly I'm glad to say and is approximately along the line that the yellow arrow is pointing.

post-400-126900941776_thumb.jpg

 

In the next image you see the same in Dark Radiant with the model highlighted. One thing I didn't tell you. As well as the glitch in the model, I also had to rotate the texture 90 degrees on the brush to align. Dunno why but I should be able to just rotate it on the model later so that won't be needed. The brush is 128 x 128. The model is 128 x 96. Reason is that I figured 32 solid grass, 32 solid stone, 32 in the middle would be gradient. Again, I have no idea if that is the best way to do it. Maybe just the 32 gradient is enough. And how wide should this overlap be anyway for general use? 32 is about a man's stride I guess.

 

post-400-126900944369_thumb.jpg

Link to comment
Share on other sites

  • Replies 56
  • Created
  • Last Reply

Top Posters In This Topic

Once again Fidcal rules :)

 

(I just tested your Lone Heart map with HDR and its - oh my god, I'll never ever come close. There are a few nitpicks I had but nothing substantial. The amount of detail and work you did put in is just mindnumbing! :wub:

 

As for the blending, I'd like to see how it looks with two of our textures blended over. Then maybe we can judge if 32x32 is better than 64x64 or 64x128 or whatever fits best.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Can I take that you finished Heart with no major faults to report? If so, that's good. My main concern was players getting stuck and not knowing what to do.

 

On this blend front, I'll post something soon. But for now every time I try something in Blender then something new goes wrong and I get stuck and have to start over. Then I usually close it in disgust and come back a few hours later. So I only usually do half hour sessions! :laugh: Even something as trivial as making a flat panel you wouldn't think how could there be anything to go wrong?

 

That glitch above; I tried to remove and ended up with two textures on the model which were z-fighting. No idea how or how to get rid so started again.

 

Next one, I got a python error on export - cannot get object name. Why? It has a name. Started again.

 

Made a panel and exported at every stage to prove it. Got all the way up to wrapping. It wouldn't texture. I'm in edit mode. It's selected. I can't think what can be wrong. I'll try again later but otherwise ... you guessed it ... start again.

Link to comment
Share on other sites

post-2515-126902912881_thumb.png ;)

 

Yeah, but I never could get that to work. Maybe because I was trying to make a moveable or maybe because I didn't try hard enough?

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Re: the blended texture roads. Once you get the proof-of-concept down pat (and considering how small the files are), I'd think you could make a collection of turn-angles to cover maybe 0-90 degrees in 5 degree increments (does it still work when you rotate them? I'd think so, but if not, anyway 360d's in 5d increments then; the texture should rotate in line with the turn, too, shouldn't it? Then textures would always align with the straight-aways). Anyway, the point is then you could cover the whole 360 degree space pretty well, and also have kinks, winding paths. It might be some work (and some work to figure it out), but it'd be really effective and make for cool paths... (There might even be a simple & a complex set). And of course once you have a template, it'd be easier to swap textures. Maybe I'm not saying anything new that you didn't already think about, though.

 

Edit: Glad I skipped Tel's post.

 

Edit2: I guess you wouldn't want to rely on rotating the model too much because it's a square, it's probably better to keep it on the grid (because you have to mesh it with brushwork which you want on the grid), which would argue in favor of a series of corner-angles that receive from each 5d point and send to each 5d point (not too sharp though, like not <20d, basically like clock hands pointing to the different times; with acute and obtuse angles), then I guess that leads to straight-aways at each 5d angle too (you want those models to be square too). And then there's the question if you want some turns to be sharp and others gradual (maybe over 2+ models). Hmm... really need a pad and pencil to think this through, don't you?

What do you see when you turn out the light? I can't tell you but I know that it's mine.

Link to comment
Share on other sites

Yeah, talk about massive public spoilers - full instructions how to get in for an FM that is not even released yet! :rolleyes:

 

Urg. Sorry. Didn't notice it was the public forums, and I thought the mission was long released, too. (Shows how little attention I pay these days..)

 

STIFU; next time please just ask me to delete the post instead of going "Tels tels tels" - I wondered what you meant but had no idea :(

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

OK, this test has worked fine. I went for a long thin strip in the end 128 x 16. I think it might fit in better with some slopes. For example, say you have a grass patch that slopes down to the path, fitting in a sloping 16 wide model should be easier than a wider one possibly. You cannot see the join; any marks on there are on the original texture. 16 wide means some full grass and some full stone at the edges so the actual blending section is probably only visibly 10 or 12 I'd guess and looks about wide enough. Compare with the razor edge of the grass against the side slabs. :) The image on the right is the same in Dark Radiant showing the actual location of the overlaying model. It is actually 0.125 above which is not noticeable any more than most dirt decals so not really worth making a pit for it to sit over although that might need to be reviewed.

 

With simple instructions, it is relatively easy for any mapper to duplicate and convert to any texture pairs they wish, eg, straw to dirt, snow to cobbles.

post-400-126903541633_thumb.jpg post-400-126903542843_thumb.jpg

Link to comment
Share on other sites

@tels: With that first sentence, I was actually referring to what Mortem posted before me, because that feature you requested is already available. I was going to say something like "Tels == noob" but I felt like that sounded a bit too harsh, although being intended as a joke, so I replaced it with a "Tels, Tels, Tels" and an upwards looking smiley... ;)

Link to comment
Share on other sites

It is actually 0.125 above which is not noticeable any more than most dirt decals so not really worth making a pit for it to sit over although that might need to be reviewed.

 

Of course. There is a little wedge there, but that may be tolerable; no worse than decals as you say.

Still may be worth doing a round-the-clock set of angles (better for non-directional textures like dirt maybe; although it's not impossible to have brush wedges to curve a texture on the straight-away).

Results are promising. Good work, soldier.

 

(You already know this, but for the record a stone texture isn't really one for "blending". But it would look really cool if the grass texture were literally cut around the stones so it looks like the individual stones were laid right into the grass. Something like dirt and gravel are better for blending. There are probably other variations on that theme, too... But I realize this was just proof-of-concept, and for that it's great.)

What do you see when you turn out the light? I can't tell you but I know that it's mine.

Link to comment
Share on other sites

@tels: With that first sentence, I was actually referring to what Mortem posted before me, because that feature you requested is already available. I was going to say something like "Tels == noob" but I felt like that sounded a bit too harsh, although being intended as a joke, so I replaced it with a "Tels, Tels, Tels" and an upwards looking smiley... ;)

 

Ah, yeah okay. Anyway, I am aware of the "export as obj" feature, but I still couldn't get it to work. D3 always crashed or did funky black cubes. Maybe it only works for non-movables? Or there is some special trick? (Or maybe back when I tried it, it was just buggy?)

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Blending soft surfaces is great, paths and such look a load better. But for bricks etc I am knocking out a grass decal that will tile with my new grass (Its a lot of pretty painful masking to do with a 2048x2048 image :/) this method will be a bit jaggy but never the less should look quite good.

Link to comment
Share on other sites

You guys would be better off writing a plugin for darkradiant so that you can export patches as LWO or ASE. It's really hard to screw up a model when all you have to do is vertex paint.

If anybody is able to handle Python such a script is already possible with the current build. The necessary methods for accessing patches and brushes are all exposed to the scripting module.

Link to comment
Share on other sites

@demagogue: I know what you mean. I recall the snow texture in CoSaS. Instead of just covering everything in plain snow it was in drifts and the main paths were dark flagstones peeping through snow. But just as with Thief, it would take custom textures in my view. The panel is only ever going to be a soft overlap.

 

It's worrying what you said about angles. I hadn't thought of it before. I guess I thought models can be rotated so it didn't matter but of course, a curve on a brush, the texture will remain 'on the grid' as it were while the model texture would rotate. That adds to the combinations needed. Even without rotations that also applies to both sides of a path - can't just rotate the panel as I first thought (well actually in many cases maybe you can but not all.)

 

One good thing is the current panel is only 7K so one could have a 100 combos for less than 1MB.

 

First thoughts:

 

Straight panels of different lengths, say 16, 32, 64, 96, 128

Outer curves of say 128 total length, say 11.25, 22.5, 45, 67.5, 90 degrees

Inner curves ditto

Rotated straights, 5 lengths x 5 degrees of rotation = 25

 

Add to the above possibly all rotations need 5 for each 90 degrees so multiply above I think is 40 curves and 200 straights! Still do-able but unlikely. More likely a compromise to keep it reasonable. The thing is, for many applications the mapper would start with the panels compromise.

 

In my own FM I have one garden path and it's straight and the grass is only on side. I managed to smerge it reasonably so probably won't bother with the overlay but if I did then in my entire FM I only need a few straights and the end ones can run into walls so for me a single panel of say 128 would do!

 

Another application I thought of is as bevel dirt against walls but this would need blending on both edges. In fact it would be a relation of the dirt heap.

 

I wonder to what extent these models/patches can overlap without z-fighting? Assuming 0.125 height difference alternating. Maybe all the panels could blend on all four sides and the other sides be hidden to form a 'straight'. They would also form all 4 90 degree inner curves.

Link to comment
Share on other sites

The snow has several problems:

 

The method blends not only the diffusemaps but also the bump and specular maps. The snow had a bright specular and these flagstones had none so my first effort was awful with the panel very bright. I have temporarily removed the specular from the snow to confirm this in this shot. This is serious because many textures have speculars and many do not so they seem incompatible.

 

Next, despite my using the same test situation and only changing the material def, the textures are misaligned. I had to rotate 270 and even then it is not aligned. Not serious in the sense that as a one-off it is just a matter of aligning. But this method would be much more practical if all textures were aligned to the same standard. I cannot even imagine how or why it could be different unless the compass test texture I calibrated with is a very special case. I did have to rotate the model texture wrap on the compass so maybe all the others don't need that.

 

Where the snow fades exactly to the edge of the texture tile it also aligns with the edge of the stone slabs which looks unnatural. Maybe the default should be a strip within the full texture panel to avoid this. (this of course may be another alignment problem because if the edge of a brush path is not at the same place in the texture as the model then it won't work.)

 

You can see with the stone slab misalignment how difficult it is to easily see where it should align compared to the compass which is why I initially used the compass.

 

Disappointing and at the moment very unpromising or at least, limiting, for this method.I'll try some other textures.

 

post-400-126907719824_thumb.jpg

Link to comment
Share on other sites

Dirt onto cobbles is reasonable but I I had to rotate and move the texture 8 units. Hopefully this the same for all so the model can be tweaked. I don't understand what happened to the bumpmapping on both of these. They are both present in the def, saved and reloaded into doom.

 

post-400-126907960558_thumb.jpg

Link to comment
Share on other sites

Dirt onto cobbles is reasonable but I I had to rotate and move the texture 8 units. Hopefully this the same for all so the model can be tweaked. I don't understand what happened to the bumpmapping on both of these. They are both present in the def, saved and reloaded into doom.

 

post-400-126907960558_thumb.jpg

 

I think for prominent cobbles, flagstoes and other stones where we have reasonable big gaps between the stones, it would be better to make small stripes of combined textures, where the dirt really gets into the gabs.

 

For dirt/grass, grass/leaves etc, anything that is fuzzy, your blend will work - but not if one side is cobbles, bricks etc.

 

Edit: dirt stain decals can probably help conceal the edge, too.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

I see in Dark Radiant that the top of the texture image goes to the west side on a horizontal surface if 'natural' is selected. In Blender, the top of the texture image goes to the north. So to align in the model with 'natural' default brush texture without having to rotate the model in DR I need to rotate the uv wrap clockwise 90 degrees in Blender. The other alignment errors must have been due to adjustments I made earlier; these needed no adjustment.

 

I've widened the model and think it looks a lot better.

 

Dirt to cobbles...

post-400-12691802979_thumb.jpg

 

Grass to cobbles...

post-400-126918031257_thumb.jpg

 

You might think it is not realistic to blend grass to stone slabs this way but I'd score it 95/100...

post-400-126918032723_thumb.jpg post-400-126918034301_thumb.jpg

 

and I'd take the above any day over what we have now...

post-400-12691804896_thumb.jpg

Link to comment
Share on other sites

Snow is also better this way...

post-400-126918077648_thumb.jpg

 

Than this...

post-400-126918078814_thumb.jpg

 

But the above is without specular. With it we have this problem. It seems to blend both speculars I guess so they double up. Any ideas?...

post-400-12691808202_thumb.jpg

 

Even without the specular there seems to be a problem. I see a dark area on the stone slabs where the model is...

post-400-126918083227_thumb.jpg

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recent Status Updates

    • nbohr1more

      Was checking out old translation packs and decided to fire up TDM 1.07. Rightful Property with sub-20 FPS areas yay! ( same areas run at 180FPS with cranked eye candy on 2.12 )
      · 2 replies
    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 5 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
×
×
  • Create New...