[2.2] Low poly art colour direction for best Ogre efficiency

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
old_man_auz
Greenskin
Posts: 100
Joined: Tue Jun 15, 2004 5:10 am
Location: Australia

[2.2] Low poly art colour direction for best Ogre efficiency

Post by old_man_auz »

Hi,
I have a few questions for curiosity sake (I'm not really a programmer or an artist, just here to learn).

I've been playing around with Ogre 2.2.5, using the PBS HLMS. I was going with a low poly, single colour per face art style similar to something like this (not my art, from google image):
Image.
My currenty work flow is to model in blender 2.93. Create materials with different base colours and assign them to faces, export the model with blender2ogre, manually create the material.json files using diffuse, metal & roughness values to define the material colours.

OPTION A:
Do what I'm doing above, without textures to get the colours & look I want.

OPTION B:
I was thinking another possible way to do it would be to make a single 8x8 pixel texture with each pixel a different colour to define my game palette. Then in blender, scale the UV mesh down so it fits on 1 of the pixels to give colour.

So:
Option A would end up with multiple material definitions (1 per colour) and a single mesh would have multiple materials assigned to it.
Option B should have 1 material definition and 1 texture for all of my meshes??

Is option B the better way to proceed from an Ogre rendering efficiency perspective?
Are there pro's and con's to either method that would be good to be aware of?


Thanks,
User avatar
sercero
Bronze Sponsor
Bronze Sponsor
Posts: 479
Joined: Sun Jan 18, 2015 4:20 pm
Location: Buenos Aires, Argentina
x 167

Re: [2.2] Low poly art colour direction for best Ogre efficiency

Post by sercero »

It seems that option B would be the most efficient, since it reduces the batch count.

But option A might be simpler and the loss in performance might not be so bad, are you going to use so many colours that you end up with thousands of materials?
Are colours not reusable between different models?
So that you have several materials buy they are shared between models...

What about using vertex paint? Is it feasible?

Another thing, why are you using 1 pixel textures?
Seems overkill in terms of space efficiency vs convenience in my opinion, but I'm not an artist nor Blender expert.
old_man_auz
Greenskin
Posts: 100
Joined: Tue Jun 15, 2004 5:10 am
Location: Australia

Re: [2.2] Low poly art colour direction for best Ogre efficiency

Post by old_man_auz »

So, in the real world of my application, the performance difference is meaningless. I was just asking for learnings sake.
Another thing, why are you using 1 pixel textures?
I'm using one texture that is currently 8x8 pixels.
Are colours not reusable between different models?
I'm aiming to have a colour palette of 64 colours (8x8 texture) and reuse the colours between all of my art assets.

I implemented option B to test the workflow. I have one 8x8 texture file and two material definitions. Both definitions use the same texture, but change the metalic, roughness settings: One for a dull metal, one for shiny surface. (So 1 texture, 2 material definitions). So in this method, all my art assets can use either or both of the material definitions, keeps it really simple.

Option A would have zero textures, and assuming I stick 64 colours, 128 materials (each colour has dull + shiny state).

I option B sounds easier in the long run and is a easier workflow from blender.

Vertex painting is assigning colours to verticies correct? Is this information baked into the Ogre mesh files format or do you need to programmatically generate and assign the vertex colours to the mesh in code? Or do you mean you "Vertex paint" in a tool like blender, then this data is saved and exported as a texture file?
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5433
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1341

Re: [2.2] Low poly art colour direction for best Ogre efficiency

Post by dark_sylinc »

From a performance perspective, Option B.

Otherwise you'll be limited by the command processor on the GPU because you're submitting very few triangles per draw.

From usability point of view, it's up to you. You can convert between both using scripts:

From A to B: For each material, generate a texture. Then for each submesh assign the relevant UV.
From B to A: For each pixel, generate a material. Then for each UV that matches that pixel, assign that material.
paroj
OGRE Team Member
OGRE Team Member
Posts: 2106
Joined: Sun Mar 30, 2014 2:51 pm
x 1132

Re: [2.2] Low poly art colour direction for best Ogre efficiency

Post by paroj »

sercero wrote: Fri Sep 17, 2021 4:33 am What about using vertex paint? Is it feasible?
if vertexcolour is supported by HLMS PBS, this should be the most efficient way, as you can spare UV coords and the texture indirection.
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5433
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1341

Re: [2.2] Low poly art colour direction for best Ogre efficiency

Post by dark_sylinc »

Out of the box it doesn't (unlit does) because everyone has their own idea of what to do with vertex color data (that has nothing to do with colour, e.g. wind animation)

Adding vertex color via Hlms customization is easy but there is no sample showing how to do it. Perhaps we should...