Is it possible to create lit materials that aren't textured? Basically lit, solid colors

Exactly what it says on the tin. Just to be used for extremely simple visualizations. The regular solid colors of unlit materials are a little tough to look at sometimes since the edges of polygonal geometries or the curvatures of spheroids become very difficult to see.



This is probably really simple, but I just can’t seem to figure it out from sifting through the documentation and tutorials.

Set the material to use vertex colors. You can probably edit them in your 3d editor too, just make sure its really vertex colors and not one of the other many options in 3d editors to put color on :wink: If you want to do it “manually” you have to fill a color buffer and assign it to the mesh.

@normen what I was really asking is if there was a lit version of the Unshaded solid colors built in to jME. We have a modeling team that can create lit materials for us, I was just trying to ascertain whether or not I could do this without having to actually create a material file.

Just use Lighting.j3md but simply use vertex colors, its compatible down to OpenGL1 even through fixed func bindings.

So… in English?



Sorry, I’m not really a GFX programmer. I’m a physics/general software engineer. That sentence is mostly Greek to me :confused:

Sorry, you will have to have at least the level of knowledge the “Hello” tutorials give you. When you have that, make a material, enable vertex colors and then set a buffer of type color to your mesh: https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:custom_meshes

@normen to be fair, that’s not one of the “Hello” tutorials. I went through all of those. This is not one of them.



But thanks for pointing me to a resource that will help. It wasn’t immediately obvious that this is a Mesh issue and not a Material issue so my Googling didn’t turn up much fruit. This should be enough to get me started.

@dljsjr said:
But thanks for pointing me to a resource that will help. It wasn't immediately obvious that this is a Mesh issue and not a Material issue so my Googling didn't turn up much fruit.

I thought I said that.

a simpler way is to just set the DiffuseColor of the lighting material to the color you want.

Make sure you set the UseMaterialColors parameter on the material too.

@normen you did, I was referring to the Googling I did before coming here to ask around. All of my searching before was around the word Material so the tutorial you linked me never showed up in any results and I never would have found it until I became interested in meshes :slight_smile:



@nehon I think I tried that and it didn’t do anything. I made sure to set the Boolean. But I may have done something else wrong.

@dljsjr said:
@normen you did, I was referring to the Googling I did before coming here to ask around. All of my searching before was around the word Material so the tutorial you linked me never showed up in any results and I never would have found it until I became interested in meshes :)

@nehon I think I tried that and it didn't do anything. I made sure to set the Boolean. But I may have done something else wrong.


You did something else wrong. I use this all the time. You do not need a texture for Lighting.j3md. Just do as nehon says.

Normen is making things complicated, you don’t need custom meshes or vertex colors for this. Just set the diffuse color like nehon said and you’ll be fine.

@Momoko_Fan said:
Normen is making things complicated, you don't need custom meshes or vertex colors for this. Just set the diffuse color like nehon said and you'll be fine.

Sorry, I didn't see how one could fail to make the blue cube in every default app another color and thought it must be more than that ^^

Well, the blue cube is using unshaded…the point here is to use lighting but set the colour so it is a leeeettle bit more complicated…although not a lot more complicated! :slight_smile: