Blended textures a la Source Engine for Bezier objects?

Get help with installing and running the Cafu Engine here. This forum is also for general questions and discussion of all aspects regarding the Cafu Engine.
Wolfsong73
Posts: 7
Joined: 2015-01-06, 14:59

Blended textures a la Source Engine for Bezier objects?

Postby Wolfsong73 » 2015-01-07, 16:23

Hello!

I did search for this topic, but couldn't find anything discussing it.

So, I was playing a bit with the bezier objects last night, and am loving them. Sooo much flexibility is provided by having those.

I was thinking of using beziers to create some basic terrain elements, like small cliffs with a slight overhang, etc... stuff to be used purely as deco/barriers, and it got me thinking.

I'm sure you're already familiar with this, but in the Source Engine, they have their 'displacements', which allow you to create organic objects which are (somehow) derived from basic brushes (interesting concept that). The implementation in Cafu seems far more flexible, and is a lot easier to work with - for me anyway.

Here's their Wiki page on it (for anyone who may not be familiar with it)

One cool aspect of using the Displacements in Source, is the ability to use blended materials, where you have, say, grass and dirt in a single material. When applied to a displacement, you can then paint the surface to blend between the two; it seems to be done with vertex blending. It's very handy and allows you to create a variety of natural shapes, with more realistic texturing (e.g. stone which blends into dirt/grass where it meets the ground, etc).

I'm wondering if this is something that could, and/or may be implemented into Cafu? I know you're busy and have a lot of other priorities with the engine, Carsten, so many just something for the "somewhere down the road" list...? :p.

Thanks!
User avatar
Carsten
Site Admin
Posts: 2130
Joined: 2004-08-19, 13:46
Location: Germany
Contact:

Re: Blended textures a la Source Engine for Bezier objects?

Postby Carsten » 2015-01-07, 18:38

Hi Wolfsong73,

Wolfsong73 wrote:So, I was playing a bit with the bezier objects last night, and am loving them. Sooo much flexibility is provided by having those.

Thanks, it's great to hear that!

I'm sure you're already familiar with this, but in the Source Engine, they have their 'displacements', which allow you to create organic objects which are (somehow) derived from basic brushes (interesting concept that). The implementation in Cafu seems far more flexible, and is a lot easier to work with - for me anyway.

Yes, it looks as if they used brush faces to provide the base planes of their "terrains". As these base planes can be arbitrarily oriented, you can create shapes with "displacements" that can, at this time, not be created with terrains in the Cafu Engine (where the terrain base plane is always the X/Y plane). However, this is a limitation that I plan to overcome soon, as it is another (indirect, but) natural follow-up to the introduction of the Entity Component System.

(Given this, I wonder why in Source they didn't take it a step further and established "displacements" independently of brushes, just like terrains in Cafu. It would have been simpler to the user and equally powerful.)

One cool aspect of using the Displacements in Source, is the ability to use blended materials, where you have, say, grass and dirt in a single material.
[...]
I'm wondering if this is something that could, and/or may be implemented into Cafu?

Well, I'm sorry to say that you have identified another weak spot in our current feature set. ;-)
Yes, I'm sure that this could be implemented, but as with proper terrain lighting, it would take some dedicated time looking into it...
Best regards,
Carsten
Wolfsong73
Posts: 7
Joined: 2015-01-06, 14:59

Re: Blended textures a la Source Engine for Bezier objects?

Postby Wolfsong73 » 2015-01-08, 02:04

Carsten wrote:Yes, it looks as if they used brush faces to provide the base planes of their "terrains". As these base planes can be arbitrarily oriented, you can create shapes with "displacements" that can, at this time, not be created with terrains in the Cafu Engine (where the terrain base plane is always the X/Y plane). However, this is a limitation that I plan to overcome soon, as it is another (indirect, but) natural follow-up to the introduction of the Entity Component System.

(Given this, I wonder why in Source they didn't take it a step further and established "displacements" independently of brushes, just like terrains in Cafu. It would have been simpler to the user and equally powerful.)


Actually, I think the Bezier surfaces provide a lot more flexibility (no pun intended), and are also a lot easier to work with than Displacements, which can be rather quirky.

The main benefits to using Displacements is that you can kinda "block in" your areas prior to converting it to a disp, and of course the ability to paint the blended textures.

Beyond that, the way you edit Beziers is, to me, far more intuitve and easier, as you're directly grabbing and manipulating the control points and can move them whatever which way you want (hooray for alliteration!). Displacements are modified almost like you're editing a heightmap terrain, with a brush, and - to me at least - it always feels very clunky to me.

Now, of course, you can get some great results with Displacements; just look at the Half Life 2 series games. Or, for an even better example of what you can do with the displacements (albeit with a *lot* of time and effort, trial and error), check out Dear Esther. That's done in Source Engine, and is largely done with Displacements. Video here.

Absolutely stunning environment design in Dear Esther, regardless of what engine it was done in... but especially so considering the age of the Source engine.

That said, I think the implementation in Cafu is more intuitive and flexible, at least from the designer point-of-view, and at least for me. If nothing else, it's a very strong foundation to, perhaps, build from, should that be a goal.

Carsten wrote:Well, I'm sorry to say that you have identified another weak spot in our current feature set. ;-)
Yes, I'm sure that this could be implemented, but as with proper terrain lighting, it would take some dedicated time looking into it...


lol nothing to be sorry for, sir. I've seen pre-baked terrain lighting/shading before, and it works fine, so long as the rest of the lighting matches (which is the designer's responsibility :P). I'll just have to work out a workflow with the tools I have now. I know Blender does some nice baking, including Ambient Occlusion, so I can get even more detail into the final product.

Thanks for the replies!
User avatar
Carsten
Site Admin
Posts: 2130
Joined: 2004-08-19, 13:46
Location: Germany
Contact:

Re: Blended textures a la Source Engine for Bezier objects?

Postby Carsten » 2015-01-08, 20:24

Wolfsong73 wrote:Actually, I think the Bezier surfaces provide a lot more flexibility (no pun intended), and are also a lot easier to work with than Displacements, which can be rather quirky.

:-D

The main benefits to using Displacements is that you can kinda "block in" your areas prior to converting it to a disp

According to the wiki page that you linked above, displacements don't seal the level, so you still have to use another set of (ordinary, non-displaced) brushes to make sure that there are no leaks, do you?

Beyond that, the way you edit Beziers is, to me, far more intuitve and easier, as you're directly grabbing and manipulating the control points and can move them whatever which way you want (hooray for alliteration!). Displacements are modified almost like you're editing a heightmap terrain, with a brush, and - to me at least - it always feels very clunky to me.

Cafu uses three geometry primitives that each have a clear and distinct purpose, both technically as well as for the user, and are fully independent of each other: brushes, Bezier patches and terrains (heightmaps). (Actually, there are also models and plants, but that is another story...)

In Source, "displacements" are actually heightmaps that are somehow piggybacked onto brushes. This is why I was wondering why they mixed concepts, rather than keeping separate things separate...

[...], check out Dear Esther. That's done in Source Engine, and is largely done with Displacements. Video here.

Thanks for the link, that indeed looks very impressive!

It would probably be very interesting trying our HL2 vmf map file importers on these map(s)...

That said, I think the implementation in Cafu is more intuitive and flexible, at least from the designer point-of-view, and at least for me. If nothing else, it's a very strong foundation to, perhaps, build from, should that be a goal.

Thank you very much for your encouraging words, very much appreciated! :wohow:
Best regards,
Carsten
Wolfsong73
Posts: 7
Joined: 2015-01-06, 14:59

Re: Blended textures a la Source Engine for Bezier objects?

Postby Wolfsong73 » 2015-01-08, 23:13

Carsten wrote:According to the wiki page that you linked above, displacements don't seal the level, so you still have to use another set of (ordinary, non-displaced) brushes to make sure that there are no leaks, do you?


Yes, they're like Beziers in that way; they don't seal the level once they're converted to displacement surfaces.

When I say you can 'block out' areas with Displacements, I mean you can place brushes around in the very rough shape you want an area to be - say, a ground with surrounding cliffs, etc. So it's very quick to rough out the shape of an area you want to construct out of displacements. Then you select the faces you want to turn into a displacement, set them up and start editing.

You still need to have those areas sealed in, much the same as you would using Beziers.

In practice, Beziers and Displacements serve the same function - adding more flexible/organic shapes to an otherwise rather rigid format. They each just use a different approach.

Here's a video on how you work with them:


Oh! The ability to "sew" them together is very nice, too. Nice time-saver.

Return to “Cafu Engine Support and Discussion”

Who is online

Users browsing this forum: No registered users and 1 guest