Download

Fake metallic behaviour on a 2D image?

Dear All,
When developing a mobile game I found a realistic 3d setup with decent materials is hard to come by, given I wish to make the game run and use up low power on many devices.
However, some parts will move and if I pre-render the images (so it will be a 2d game after all) the reflections themselves will stay there.
Is there any way to fake the movement of the reflections? It does not have to be physically correct, if it moves that is more the enough. (Still talking about 2d images and moving reflections or bright spots on them)
Thanks in advance.

Sure the way we used to do this in the past was by just using a randomish texture that was a black texture with 3-4 random white blurry dots in various places. Then you can just use “reflection Vector” and component mask the XY, and use that as the UV’s of the reflection texture. Then you add it to the material as either basecolor or emissive additive. The down side is that it will be completely unshadowed by any moving lights or shadow casters. Doing it in the base color will hide that better but you won’t get as raw of color control as doing it in emissive, so maybe try both and play around.

You can simulate roughness by using “Mip Bias” and using the roughness texture of the underlying asset to boost the mips of the reflection texture. And then of course you may choose to multiply it by a specular color mask.

What you say makes sense - actually more sense than what I thought of (with no experience on my side).
My idea was similar - to render out a raw reflection pass at my primary 3d app, then overlay on top of the image and scale it up and down in respect to the position of the image.

Now, I would say I use the raw refl pass, make it transparent where it has to be. The other things, I get what you say, I just have no clue how to pull it off.
Could you explain or show a tut (either video or text with images) in case do not have the time?
EDIT: it doesn’t have to be that physically correct or use shadows. if it moves, it is fine, so it isn’t the obvious static fake reflection :smiley:
Now, is it possible to assign mats to images? I thought only 3d objects can have mats.

I was suggesting putting it on your actual objects in their materials, not on a separate card that is floating above them. That way the reflection vector picks up on the normals of your meshes.

I set up a very basic version. This also adds camera X movement into panning the reflection which could be useful for a side scroller. The speed of the pan is based on the editable float (called none below).

FakeReflections.PNG

Note that above, I have masked the reflection vector XY which means this works as a top-down view. If your camera was instead looking along X instead of Z, you would mask GB. Or if your camera was looking along Y, you would mask RB. If you need arbitrary camera angles you can transform the reflection vector from world to view space and then just mask XY.

If you do cameraposition - objectposition before masking the Red channel, then it will move the same whether the camera or the object moves which will help. I should have added it but just thought of it after posting.