Texture blending idea

Posted By: Thomas_Nitschke

Texture blending idea - 10/11/06 13:50

Supposing I got that correctly, 3DGS currently renders each group of a model in a seperate pass. That said, I thought probably you could make A6 render the geometrical edges of a group with decreasing opacity (from in- to outside), giving it a smooth-edge effect? This would allow for automated texture blending since two groups with different textures and the suggested "fadeout" effect on their edges would then more or less blend into each other.
As you might have noticed, I don't really know much about those D3D internals, but nevertheless I thought I could as well at least share my idea. Any thoughts, anyone?
Posted By: jcl

Re: Texture blending idea - 10/16/06 10:18

Rendering groups with decreasing opacity can be done with a shader; glow shaders use this method. However I am not sure that I understand what fadeout or texture blending effect you want to achieve?
Posted By: Thomas_Nitschke

Re: Texture blending idea - 10/16/06 21:03

Well, suppose you've got a simple plane of 5x5 faces, and another one the same size. Suppose these two planes are aligned next to each othere, just they slightly overlap. Now if each plane has a different group assigned, you could have the edges of each group render with decreasing opcaity, just as described in my previous post. Since the groups are overlapping each other, a decreasing opacity on the edges would result in the two groups smoothly blending into each other. Suppose the two groups have different textures, these would then blend into each other as well.
If this can be done with a shader, I'll ask in the shader forum since I wouldn't know how. Anyway, I thought as the engine is rendering each group in a separate pass anyway, you could probably integrate such a routine into the engine directly.
Does that make any sense?
Posted By: jcl

Re: Texture blending idea - 10/17/06 07:25

Yes, but I think this is a very special purpose that most users won't need, and thus not suited for being hardwired in the engine.
Posted By: Thomas_Nitschke

Re: Texture blending idea - 10/17/06 09:32

Probably. However, the only two ways to achieve blended textures in 3DGS, currently, are either using transition textures or a multitex-shader with blendmap, and I think there should be an easier method. Simply the strange one I posted was the only way I could think of, but I'm sure there are other methods for texture blending.
In concrete: An easy texture blending option, if possible one that even applies to blocks, would be great. And I think others would definitely like that, too.
Posted By: Thomas_Nitschke

Re: Texture blending idea - 10/30/06 18:38

*BUMP*
Any thoughts anyone?
Posted By: Matt_Aufderheide

Re: Texture blending idea - 10/31/06 17:53

Quote:

the only two ways to achieve blended textures in 3DGS, currently, are either using transition textures or a multitex-shader with blendmap,




Incorrect.. in a shader you have other options, such as blending by height, slope, location, etc.

However, what would be helpful in this regard is the ability to arbitrarily set vertex data, such as by using vec_to_uv, but to additional texture coord sets and vertex colors.

Currently, unless im mistaken, vec_to_uv only affects texcoord0 .. you ought to be able to set any of the sets. Additional you could set vertex color as well.

This way you can store a per-vertex color for blending, without the need for additional blend maps in the shader, and you can precalculate slope and hieght values for efficiency.
Posted By: Thomas_Nitschke

Re: Texture blending idea - 11/01/06 22:17

Matt, I appreciate your explanations. I'm glad that finally somebody seems to be interested in this, other than me myself.
However I'm afraid I simply lack knowledge to be able to follow you - could you probably try and explain the thought about vec_to_uv in a way that's more made for the idiots among us?

Thanks in advance!
Posted By: Matt_Aufderheide

Re: Texture blending idea - 11/02/06 04:15

Simply that it would be useful if you could set vertex atributes other than texcoord0 in script (it may already be possible, I really dont know).

A D3DXMesh has a number of vertex attributes, defined in the mesh declaration or vertex format. This can include a given number of texture coords, colors, etc.

In d3d you can chnage the data in the mesh by locking the vertex buffer and writing to it, this is how vec_to_vertex and vec_to_uv work.

It would be helpful if more of this functionality from D3D was exposed in script. You can store lots of useful data in vertex attributes, and in relation to this topic, you can store colors that can be used to blend textures per-vertex, without the need for additional textures in the blending shader.
Posted By: Thomas_Nitschke

Re: Texture blending idea - 11/02/06 09:20

That sure sounds really interesting!
I think I'm slowly getting the idea - However one thing I still can't imagine: In case you could blend textures on a per-vertex basis, what would that probably look like to the user? How would you proceed in defining which texture would be visible at which places?

Cheers
Posted By: Matt_Aufderheide

Re: Texture blending idea - 11/02/06 21:48

Many current terrain engines in modern games use vertex colors for blending. Vertex colors are used just like the pixel colors in a blendmap. You can use the r,g and b values to blend different textures, just thats it's on a per-vertex level not per-pixel.

In normal practice, because terrains have reasonably high, regular tesselations, this is almost inditinguishable from per-pixel blending. Also, it gives you the ability to pre-compute more complex blending methods, such as height and slope blending. You can additionally use a seperate micro-blender texture to give the fades some per-pixel qualities, to even out and make the fade look more natural.
Posted By: Thomas_Nitschke

Re: Texture blending idea - 11/03/06 15:43

Thanks a lot for explaining!
That sure sounds like a great option... JCL, any chance?
Posted By: FBL

Re: Texture blending idea - 11/10/06 16:54

anyone?
Posted By: Childair

Re: Texture blending idea - 11/10/06 19:21

like many level making in strategy games, and would be great to be incorporated into the mel.
Posted By: Thomas_Nitschke

Re: Texture blending idea - 05/31/07 00:02

*Huge bump*

I thought I'd bring this up again, as I still think it would be quite a useful feature...
© 2023 lite-C Forums