How to make a shader that renders each object in the scene in a different flat color?

I was attempting to see if the UE4 shader editor would support rendering based on the object id in the scene, but there does not seem to be a premade shader input for the object id or equivalent. Will I need to modify the renderer directly in order to make shaders using object ids as input?

You could use ObjectPositionWS to drive your color. With proper setup, it could give an appearance of all objects having random colors.

Thanks for the suggestion! That should work well, except in the case that things are moving in the scene, in which case their colors will change over time.

For your moving objects, You could assign individual material instances, and generate random colors in blueprints/code, rather doing it via shader.

That’s an interesting suggestion – thanks!