Jump to content
Niosop

Vertex painting in editor

Recommended Posts

At some point in the future it would be nice if the editor would allow you to vertex paint meshes on a per instance basis. This would let us add almost infinite variety to meshes without having to generate a separate texture for each instance (moss on rocks, cracks on pillars, etc, etc). Ideally we'd be able to select up to 5 materials for a mesh, and use the RGBA channels to determine blending between them kind of like the terrain system currently does. I suppose the .sbx file would have to store vertex color information along with the position/scale/rotation info it already does or reference a separate file for each mesh that had vertex painting applied. A separate file by sbx assigned ID number might be best because then it could be binary and take up much less room.

 

It could be just like the terrain editor paint feature, just allowing you to pick materials instead of just textures. But even just using something exactly like the terrain shader would be fine (diffuse/normal/specular).

Share this post


Link to post

Really? Have a link to it? Eternal Crisis is working on one now, and I'm working on a little editor that will let you do the painting and save out a vert color file, but if there's already a shader written it would make EC's job easier.

Share this post


Link to post

Awesome, that's almost exactly what I'm going for. Will add a couple extra textures (base texture + 4 in RGBA channels), and normal/spec maps for each for a total of 10. Then I just have to write a little program that will let you walk around your scene and splat the textures onto your static objects to add variety. Have it export the data you painted to files and make a custom post load function that will look through and apply them and we're good to go :D

 

Thanks so much, this will help save a lot of time.

Share this post


Link to post
vertex paint meshes on a per instance basis

You'd lose GPU instancing with that. (Meshes that are instantiated all look exactly the same, except for color. Having texture arrays would change this a little bit

(then they could also have individual textures), but I don't think it's possible to specify vertex color data per gpu instance.)

 

moss on rocks, cracks on pillars, etc, etc

You'd rather do things like that with decals, best with projected decals:

Decals_image021.png

Share this post


Link to post

You'd lose GPU instancing with that. (Meshes that are instantiated all look exactly the same, except for color. Having texture arrays would change this a little bit

(then they could also have individual textures), but I don't think it's possible to specify vertex color data per gpu instance.)

 

Yeah, I'm loosing GPU instancing for those things that are painted. Won't know for sure if the performance hit is acceptable until I try it on a large scale.

 

You'd rather do things like that with decals, best with projected decals:

 

I was considering decals, but I thought that having multiple overlapping decals tended to cause Z fighting among them? Is this incorrect? Since the decal is a new surface, wouldn't it incur a similar performance hit? Probably less polys in the decal than in reconstructing the surface, but I don't think poly count is nearly as much of a concern as draw calls now days. I could be (and usually am) wrong though. Reconstructing the surface is basically the same thing as a decal but you don't need the original surface any longer (not sure if that saves anything since it would have been instanced anyways).

 

I suppose if there was a way to directly access texture data in memory then I could generate the desired texture composite dynamically and assign it to a decal, but I haven't figured out how to access texture data yet.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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.

×
×
  • Create New...