Is there some simple material in BJS without PBR for 2D games?

I need some simple material that just renders without lighting impacts or other PBR-stuff like this to use it in my 2D game.

StandardMaterial looks like overhead for this task. I wanna create tycoons and tower defense like games with much sprites so I need some more lightweight mat that StandardMaterial.

What as for SpritePackedManager? Yeah, some sort of. I wanna create 2.5D games where I wanna add some 3D colliders to that sprites but looks like sprites cannot be added as a child to meshes. So I should move all those hierarchy manually at the same time. Maybe it’s not the best solution or maybe I miss something here. Refs to such games, for example, it’s like Monkey Mart from Poki. 2D stylized game with some 3D-look like scene.

Sure, I can make some sort of Unlit material with the StandardMaterial:

mat.disableLighting = true;
mat.emissiveColor = new Color3( 1, 1, 1 );

but looks it aslo is like an overhead as it comes to simple unlit mat :smiley:

Maybe someone already faced that kind of task?

SimpleMaterial.

Looks like SimpleMaterial doesn’t support opacity? I need an opacity support…
So I think I need not so simple material :smiley:

Do you need an opacityTexture or a full-mesh alpha/transparency value?

It looks like useAlphaFromDiffuseTexture is not available. But is its inherent value “true”? If you need something like opacityTecture, what happens if you specify a diffuseTexture that includes alpha values?

If you don’t need a per-pixel opacity and just want a full-mesh alpha value, I see the following properties/methods (but not sure what each of them do):

  • alpha
  • alphaMode
  • transparencyMode
  • getAlphaTestTexture
  • needAlphaBlending
  • needAlphaBlendingForMesh
  • needAlphaTesting

Also, see StandardMaterial with disableLighting = true

1 Like

Well, alpha is not what I’m talking about. Alpha it is a “object transparency” when I need to use PNG with alpha channel. For instance: place a character png on a plane.

If I use SimpleTexture - all tranparent areas show as a black color.

1 Like

Yeah, that works (and emissiveColor set to white), but I think using StandardMaterial as a simple unlit shader is a bit overhead :smiley:

This seems to directly address your question. I would take this as gospel, given the poster, at least as of the time of posting.

Well, it looks like I better stop looking for something faster than StandardMaterial and just stick to that for now. And when there’ll be a better times then maybe create some simple unlit shader by my own and compare performance with the StandardMaterial. It’s a 3-4 lines of code, but I don’t know how to use shaders in BJS at all so it will be a challenge for me :smiley:
Thanks for pointing me to that post.

1 Like

StandardMaterial unlit will be the safest as it supports all of the framework functionalities.

You could also think of creating your own in either NME or even as a shader material or maybe for simpleMaterial in a simpleTransparentMaterial :slight_smile:

1 Like