Texture Splatting using a DLL?
Blitz3D Forums/Blitz3D Programming/Texture Splatting using a DLL?
| ||
Has anybody succeded in doing texture splatting using a DLL, like Tom Speed's? It gives out SetTextureStageState function but doesn't provide a SetTexture function so that we can specify what texture do we use. I have no C++ knowledge so I wouldn't even dare to make a DLL to cover that up. PS: The texture splatting method I'm refering to is the one that binds the diffuse map with an external alpha map that you would supply, instead of using the one directly from the diffuse map. |
| ||
Basically, it would be these same steps:// Alphamap: take the alpha from the alphamap, we don't care about the color g_Direct3DDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1); g_Direct3DDevice->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE); // Texture: take the color from the texture, take the alpha from the previous stage g_Direct3DDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_SELECTARG1); g_Direct3DDevice->SetTextureStageState(1, D3DTSS_COLORARG1, D3DTA_TEXTURE); g_Direct3DDevice->SetTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1); g_Direct3DDevice->SetTextureStageState(1, D3DTSS_ALPHAARG1, D3DTA_CURRENT); g_Direct3DDevice->SetTexture(0, g_Alphamap); g_Direct3DDevice->SetTexture(1, g_Texture); g_Direct3DDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, g_Vertices, sizeof(QuadVertex)); Is there any way to do this with Tom's DLL? (except the rendering part, which would be the RenderWorld) |
| ||
See FastExt library and FastExt_Example_TextureBlends.bb example. |
| ||
Texture splatting? |
| ||
http://en.wikipedia.org/wiki/Texture_splatting :) |
| ||
You can use texture splatting with FastExt without problems. What for again to invent a "bicycle"? :) |
| ||
Ah right, gotcha. Excuse the laziness :P |
| ||
I'm considering this like a personal challenge (that's why I don't just buy a lib to take care of it). Plus, I end up learning something too. I managed to get pixel fog running through the simple RenderState changing, so this is doable too (especially Range Fog which is very useful). The only problem is how to apply the texture stages to the individual textures, like MikhailV did it. Sehaijyn managed to get it too: http://blitzbasic.com/Community/posts.php?topic=52663 |
| ||
. |
| ||
nope. sorry |
| ||
Nevermind! After some diagnostics, I think I got it....kinda.... |
| ||
Good lad :D |
| ||
Yeah, I'm still having some trouble with doing it manually but...man... I was taking a look at those libraries at http://www.fastlibs.com and I gotta say they look amazing! Using FastExt, with just two calls to their proprietary TextureBlend function, they set up texture splatting with no trouble: - Just so you know, the grass texture is using an alpha channel from a totally different texture, one loaded simply to provide the external alpha channel. These libs are fantastic, especially FastExt! they give a whole new level of control over Blitz3D. |
| ||
Thanks :) This comfortable and quickly! |