Jump to content

Anyone successfully implemented model texturing using vert coloring?


Scott Richmond
 Share

Recommended Posts

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?

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

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.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

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?

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

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.

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

 

 

76561198023085627.png

Link to comment
Share on other sites

Are you trying to make a texture splatting shader from rgba vertex colors for terrain?

 

This

3drad2010081310261080.jpg

 

Translates to

3drad2010081310263041.jpg

 

I think this is the way LE does terrain texturing.

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

 

 

76561198023085627.png

Link to comment
Share on other sites

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).

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

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.

HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB

Link to comment
Share on other sites

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?

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

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. :)

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

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

HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB

Link to comment
Share on other sites

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?

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

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...