I'm fairly new to shaders and OpenGL so bare with me please, I just want to make sure I'm doing it correctly! Now I'm using LibGDX in order to create a simple 3d diagram for my company. I have a few models that I need to display as grey until they are active, where they will fade to a brighter blue, probably gain some emission value so that they're brighter.
Now, when I export my models from Blender to .fbx, and then run Fbx-Conv to generate .g3dj files, I get some output like the following:
"materials": [
{
"id": "glowy_blue_material",
"ambient": [ 0.000000, 0.000000, 0.000000],
"diffuse": [ 0.000000, 0.753256, 1.000000],
"emissive": [ 0.000000, 0.753256, 1.000000],
"opacity": 0.592209,
"specular": [ 0.000000, 0.759441, 1.000000],
"shininess": 9.607843,
"textures": [
{
"id": "Texture",
"filename": "heat_exchange_uv_edge_highlight.png",
"type": "DIFFUSE"
}
]
}
]
Which is all good and displays what I want, but I've been reading about shaders the past few days and see that in a lot of cases LibGDX suggests extending the default shader and making tweaks that way.
From a computational point of view, what is the best way to go about switching colors of models? Extending the default shader with some logic about if x is inactive, change shader to render as greyscale, else render as normal blue material? Or should I create a greyscale version of the material and switch them out? ( I'm not quite sure how to do this, also, because I apply the material in the g3dj file — could I do this in Java instead of the g3dj file? Does it cause a performance hit? If anyone could point me in the direction of some documentation somewhere.. )
Any help would be appreciated. Thanks!