Object color change based on camera FOV (heatmap)

Hi, I would like to implement(or use if there is implementation already) heatmap based on camera FOV. What I mean by this is following:

  • environment (or copy of environment) start at dark blue color
  • as player move, section of environment captured by player camera increase it RGB value from blue to green, to yellow, to red - depending how long is player looking at that environment section
  • I would like to have color change relative to other object color. What I mean by this - if total length of game is 10 min and player was looking at tree for first 3 minutes, part of the tree becomes orange/red, but then player looks at the house for 7 minutes. I want captured part of the house to be red and the tree part is decreased to green/yellow
  • export final environment colors so I can analyze it

I made research on google, redidt atc. but found nothing. I’m not sure how to implement it so first of all, is something like this even possible ? If yes what’s the best approach to do it ?

PS: I’m on Linux

A heat map something like this? Elias Wick | Thermal Vision

No. I mean something like this UE4 Tutorial - Make a Basic Heat Map - YouTube . But not by position but by camera FOV. So the object start to became “hotter” the more you state at them.

Do you want exactly the viewed pixels to become hotter, or is it just “each object that’s probably visible?”
E g, if a small rock is behind a big house, but in front of the camera, should the rock become redder?

If you need “visible pixels,” then you need to have a full parameterization (unique UV mapping, similar to light map UV channel) and treat the camera as a light source and accumulate non-shadowed pixels into the per-object “light map,” which will likely require custom work in the renderer and potentially also be slowish.

If you just need “objects in frustum,” then you can run a visibility query for each object in approximately the right place for each frame, and add a counter for how many frames the objects has been in frustum. You might keep a TMap<> of objects and their material instances and counts, for example. Then make a material parameter collection that contains “total number of frames,” and maybe “maximum object frame count” (for the relative bit,) and make a material parameter for the material you add to each object that you update every frame with the frame count for that object.

1 Like