Multitexturing with Texture Atlas
BlitzMax Forums/MiniB3D Module/Multitexturing with Texture Atlas
| ||
Hello All, Question; I'm working on a new game and I trying to see if anyone can help me with a problem I have been having.. I'm using a texture atlas for my Terrain images, and I want to use Multi texturing for the blending between the two selected textures, but I'm not sure if you can overlap textures like I want and get a smooth transition. Basically what I'm trying to do is this.. each texture is loaded to each polygon and then you can change the texture of the polygon by assigning the texture from the atlas then I want a smooth overlap of two textures. I know that most multi-texturing is done with three textures (Grass, Mask, Dirt as example) and then the mask is either white, black or mid range (grey or so), but I was hopping I could do a tilling like effect similar to warcraft3. Please let me know your thoughts on this one.. Thanks, FBEpyon |
| ||
The last three entries on this post: http://blitzmax.com/Community/posts.php?topic=94623 As for texture splatting (what i think youre after) I think people use masks or shaders. |
| ||
I think you can do this without using splatting. If you use an atlas you can have each tile mesh in your terrain be broken, separate quads (not welded at the vertices) so each can use different tiles from the atlas. Then you can use something in your atlas similar to the way RPGMaker works to make transitions, which is the "Auto Tile" functionality. This only works on pairs of materials, so if you're going to have 3 materials overlaying at the same time you'll need to use splatting or mesh layering. |
| ||
Thanks for the replies, I was thinking about it some more, and I was hoping that I wouldn't have to un-weld my vertices, the reason I'm saying this is when raising and lowering the terrain you could run into a problem with seems not lining up correctly. I guess I will have to make due with shaders and/or masks and just do three textures per segment of terrain. FBEpyon |
| ||
Hello All, I just wanted to give you all a update, I have managed to get multit-exturing to work with a bit of help with minib3d ext 2, and it works amazing and fast, I can do several layers of textures and be able to also have bump mapping, I will post a screen in the next few days.. Thanks for the help, FBEpyon |
| ||
cool. Is ext2 using shaders or register combiners for the bump mapping? I always wanted to like klepto's minib3d but he coded it in his style, not the minib3d style, so it felt too disconnected. |
| ||
Hell Adam, Hey its not very Minib3d'ish and I have a hard time getting used to the way things are done with his, but it works, I was looking at yours and I was hoping to see if complete because its starting to look very nice.. I'm using 100% shaders. Which works for me, now I can add them to my world editor for my game, and hopefully get something out for everyone to see.. I'm also using my Multiple Region system I made a while back, still working on it a bit (improvements). I also like the shaders because this gives me a chance to have water in just a few lines of code and not have to worry about setting up cube mapping and/or cameras for it. Link: http://www.blitzmax.com/Community/posts.php?topic=94277#1080954 FBEpyon Last edited 2011 |
| ||
So hate double posting but I figured I would give you all a update on what is going on with my terrain system and multi-texturing.. I have manage to combined Multi Texturing/Cel Shaded Lighting to my terrain now I'm working to figure out how you would add in a timer to the shader to control the time of day and adjust the light direction and color based on this information.. Any ideas..? FBEpyon |
| ||
Use a Uniform variable. Then you can input any numerical data type (int, float, float[]) from your application (the client) to the shader code. This numerical value would be your time, that you can use as any other variable in your shader code. A Uniform variable is a read-only value that's the same throughout the entire rendering of the mesh. So it can be used for values that shouldn't change on a per-vertex basis (this per-vertex value would an Attribute). You can read more about Uniforms and GLSL on the web: http://www.opengl.org/wiki/GLSL_Uniform Last edited 2011 |