Scott Richmond Posted July 9, 2012 Share Posted July 9, 2012 I'm about to attempt to create a simple model in Maya 2013 and texture it using vertex coloring. What I want to do is be able to procedurally texture the model via code and a shader using vertex painting. In Maya I will define the color of the vertex's and then supply the textures in the shader at runtime. For example a 2D plane model: x = a vertex x---x---x | \ | / | x---x---x | / | \ | x---x---x I want each of the verts to have their own color that I can assign a texture to in runtime. In this thread I'd like to ask if anyone has been able to do this successfully from Maya? Any other advice? Quote Programmer, Modeller Intel Core i7 930 @ 3.5GHz | GeForce 480 GTX | 6GB DDR3 RAM | Windows 7 Premium x64 Visual Studio 2008 | Photoshop CS3 | Maya 2009 Website: http://srichnet.info Link to comment Share on other sites More sharing options...
Canardia Posted July 9, 2012 Share Posted July 9, 2012 Leadwerks supports vertex coloring. I imported once a vertex colored car and it looked quite decent without any textures. Not sure what formats Maya supports, but with UU3D you should be able to get it right into Leadwerks. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Scott Richmond Posted July 9, 2012 Author Share Posted July 9, 2012 I appear to have been able to import a model with vertex coloring - The untextured model itself has the colors I specified. Now I need to work out how to access these colors in a frag shader and apply blends between textures. Any ideas or resources to check out? Quote Programmer, Modeller Intel Core i7 930 @ 3.5GHz | GeForce 480 GTX | 6GB DDR3 RAM | Windows 7 Premium x64 Visual Studio 2008 | Photoshop CS3 | Maya 2009 Website: http://srichnet.info Link to comment Share on other sites More sharing options...
LordHippo Posted July 10, 2012 Share Posted July 10, 2012 I appear to have been able to import a model with vertex coloring - The untextured model itself has the colors I specified. Now I need to work out how to access these colors in a frag shader and apply blends between textures. Any ideas or resources to check out? "fragcolor" is what you're looking for. Quote Ali Salehi | Programmer Intel Core i3 2100 @ 3.0GHz | GeForce GTS 450 | 4GB DDR3 RAM | Windows 7 Ultimate x64 LE 2.50 | Visual Studio 2010 | RenderMonkey 1.82 | gDEBugger 5.8 | FX Composer 2.5 | UU3D 3 | xNormal 3.17 Link to comment Share on other sites More sharing options...
Scott Richmond Posted July 10, 2012 Author Share Posted July 10, 2012 "fragcolor" is what you're looking for. Thanks mate. I'll do some research around that when I get home. Would love any examples too though. Quote Programmer, Modeller Intel Core i7 930 @ 3.5GHz | GeForce 480 GTX | 6GB DDR3 RAM | Windows 7 Premium x64 Visual Studio 2008 | Photoshop CS3 | Maya 2009 Website: http://srichnet.info Link to comment Share on other sites More sharing options...
shadmar Posted July 10, 2012 Share Posted July 10, 2012 Are you trying to make a texture splatting shader from rgba vertex colors for terrain? This Translates to Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
LordHippo Posted July 10, 2012 Share Posted July 10, 2012 Are you trying to make a texture splatting shader from rgba vertex colors for terrain? This Translates to I think this is the way LE does terrain texturing. Quote Ali Salehi | Programmer Intel Core i3 2100 @ 3.0GHz | GeForce GTS 450 | 4GB DDR3 RAM | Windows 7 Ultimate x64 LE 2.50 | Visual Studio 2010 | RenderMonkey 1.82 | gDEBugger 5.8 | FX Composer 2.5 | UU3D 3 | xNormal 3.17 Link to comment Share on other sites More sharing options...
Scott Richmond Posted July 10, 2012 Author Share Posted July 10, 2012 Are you trying to make a texture splatting shader from rgba vertex colors for terrain? More or less exactly that yes Shadmar. However I'll need more than 3 textures (pure R, B and G). Quote Programmer, Modeller Intel Core i7 930 @ 3.5GHz | GeForce 480 GTX | 6GB DDR3 RAM | Windows 7 Premium x64 Visual Studio 2008 | Photoshop CS3 | Maya 2009 Website: http://srichnet.info Link to comment Share on other sites More sharing options...
shadmar Posted July 10, 2012 Share Posted July 10, 2012 It's simple to do RGB plus A for the fourth, but if you need more than 4 it gets complicated since all colors consist of RGB. You need to have layers of multiple RGBA maps blended with a mask. I don't think you can't have vertexcolors only then. Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
Scott Richmond Posted July 10, 2012 Author Share Posted July 10, 2012 It's simple to do RGB plus A for the fourth, but if you need more than 4 it gets complicated since all colors consist of RGB. You need to have layers of multiple RGBA maps blended with a mask. I don't think you can't have vertexcolors only then. Ah I thought that was the case. What are my options Shadmar? What do the LE terrain shaders do to achieve 16 texture layers? What about using UV channels? Quote Programmer, Modeller Intel Core i7 930 @ 3.5GHz | GeForce 480 GTX | 6GB DDR3 RAM | Windows 7 Premium x64 Visual Studio 2008 | Photoshop CS3 | Maya 2009 Website: http://srichnet.info Link to comment Share on other sites More sharing options...
shadmar Posted July 10, 2012 Share Posted July 10, 2012 I haven't studied the terrain shaders that comes with LE. No lesdk on my phone (on vacation) :-) Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
Scott Richmond Posted July 10, 2012 Author Share Posted July 10, 2012 I haven't studied the terrain shaders that comes with LE. No lesdk on my phone (on vacation) :-) haha no problems mate. Would love your advise once you're back from vacation though. Quote Programmer, Modeller Intel Core i7 930 @ 3.5GHz | GeForce 480 GTX | 6GB DDR3 RAM | Windows 7 Premium x64 Visual Studio 2008 | Photoshop CS3 | Maya 2009 Website: http://srichnet.info Link to comment Share on other sites More sharing options...
shadmar Posted July 16, 2012 Share Posted July 16, 2012 From what I can see the default LE terain shader uses 16 textures, but you can't use all those for different stuff like rock,grass,snow,sand etc.. So basic RGBA blend is used here too.. I would guess with accompanying bump textures, and base color texture. These are the textures fetched in terrain.frag : uniform sampler2D texture0;// texture0 uniform sampler2D texture1;// bumpmap0 uniform sampler2D texture2;// texture1 uniform sampler2D texture3;// bumpmap1 uniform sampler2D texture4;// texture2 uniform sampler2D texture5;// bumpmap2 uniform sampler2D texture6;// texture3 uniform sampler2D texture7;// bumpmap3 uniform sampler2D texture8;// texture4 uniform sampler2D texture9;// bumpmap4 uniform sampler2D texture10;// basetexture uniform sampler2D texture11;// tilemap uniform sampler2D texture12;// colormap uniform sampler2D texture13;// alphatexture uniform sampler2D texture14;// normaltexture uniform sampler2D texture15;//heightmap Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
Aily Posted July 16, 2012 Share Posted July 16, 2012 http://www.leadwerks.com/werkspace/files/file/234-lme-basic/ Here is implemented by vertex paint shaders only two layers, take a look at shaders code. Quote "Better" is big enemy of "good" Link to comment Share on other sites More sharing options...
Scott Richmond Posted July 18, 2012 Author Share Posted July 18, 2012 From what I can see the default LE terain shader uses 16 textures, but you can't use all those for different stuff like rock,grass,snow,sand etc.. So basic RGBA blend is used here too.. I would guess with accompanying bump textures, and base color texture. These are the textures fetched in terrain.frag : uniform sampler2D texture0;// texture0 uniform sampler2D texture1;// bumpmap0 uniform sampler2D texture2;// texture1 uniform sampler2D texture3;// bumpmap1 uniform sampler2D texture4;// texture2 uniform sampler2D texture5;// bumpmap2 uniform sampler2D texture6;// texture3 uniform sampler2D texture7;// bumpmap3 uniform sampler2D texture8;// texture4 uniform sampler2D texture9;// bumpmap4 uniform sampler2D texture10;// basetexture uniform sampler2D texture11;// tilemap uniform sampler2D texture12;// colormap uniform sampler2D texture13;// alphatexture uniform sampler2D texture14;// normaltexture uniform sampler2D texture15;//heightmap How is it able to use so many textures with RGBA texturing though? Can it be extended further? Quote Programmer, Modeller Intel Core i7 930 @ 3.5GHz | GeForce 480 GTX | 6GB DDR3 RAM | Windows 7 Premium x64 Visual Studio 2008 | Photoshop CS3 | Maya 2009 Website: http://srichnet.info Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.