+2 votes

Hi, I'm in the research phase for a game I want to write. This game will have an interactive mini-map of the game world. This will be a 3d map though. So my question: Is there an easy way to configure the primary viewport to use one shader for rendering a game object and configure another viewport for the mini-map to use a different shader to render the same object? The second would be a low-res version that looks like a computer display in the hud. Alternatively, design a shader that knows which viewport it is currently being used with that, alters the rendering procedure for the mini-map. This is all conceptual. Thanks for your input!

Godot version 3.2.3
in Engine by (14 points)

Have you looked into rendering a Viewport onto a texture?

1 Answer

0 votes

You can make material local to scene. So if minimap and main game reside in separate scenes it should be possible to use two different shaders for the same mesh, while keeping the rest of material parameters synchronized. I do not know if it actually works.

I was wrong above. While Viewport can use it's own World no Resources registered by Spatial nodes affects rendering(Local Materials will not work). Without extending engine in c++ only way to render same world differently from second camera is https://docs.godotengine.org/en/stable/tutorials/viewports/custom_postprocessing.html

by (892 points)
edited by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.