Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have a way to render the scene in another viewport with global shader overrides #18848

Closed
Zylann opened this issue May 13, 2018 · 10 comments · Fixed by #37949
Closed

Have a way to render the scene in another viewport with global shader overrides #18848

Zylann opened this issue May 13, 2018 · 10 comments · Fixed by #37949

Comments

@Zylann
Copy link
Contributor

Zylann commented May 13, 2018

Godot 3.x

I've been thinking about a feature that could help implement interesting rendering techniques:
Have the ability to create a viewport on which we can render the scene, but from a different viewpoint, different environment and different shaders for all the objects, without having to necessarily change (or even touch) all nodes of that scene, which makes it easier to setup.

The use cases for this are:

  • Minimap with lighter materials (less overhead due to being a separate render with lighter shaders)
  • Realtime top-down mapping, or depth map for use in other materials (ex: a grass painting system based on the height of the depth map)
  • Debug drawing (like the unshaded, overdraw and wireframe modes we know, but could also be UV, normal, or other displays)

I thought #18795 would provide this feature, but this implementation is intrusive and a bit different from what I'm seeking for.

@sdfgeoff
Copy link
Contributor

Quick note: Assuming it's an override of a single material for all of the objects in the viewport, then you will not be able to create a minimap unless every object can look the same (or you use vertex color to differentiate them) because of the issue @panzergame mentioned of all materials being the same.

The mentioned PR is not ideal because it does take setup, but there was no solution we could think of that would allow different per-object shaders and not have significant setup. Because most of these things like minimaps will only work at run-time, then automated overriding can be done by adding a script that links to SceneTree.node_added and assigns the shader to any MeshInstances that are created.

@Zylann
Copy link
Contributor Author

Zylann commented May 15, 2018

Depends how you do the minimap then, but my request really is to override all with a single shader, with no intention of differentiating objects (except maybe with culling layers, which already exist in cameras anyways?). I was just giving examples (my own use case being top-down mapping for use in shaders).

@nunodonato
Copy link
Contributor

would it make sense to have a "material override" in the world environment? considering that you can choose different world environments per viewport, it could work out

@nunodonato
Copy link
Contributor

nunodonato commented Jul 19, 2018

I did a test today, added a material override per WorldEnvironment, which enables different cameras to render in a different way

override2

override3

@fire
Copy link
Member

fire commented Dec 10, 2018

I wish to try this. Did you post a sample anywhere?

@fire
Copy link
Member

fire commented Dec 10, 2018

The goal is to implement this as a post process.

Nintendo Skew

@SIsilicon
Copy link

SIsilicon commented Sep 30, 2019

I wonder what's the status on this. It sounds very useful.

@SIsilicon
Copy link

SIsilicon commented Apr 17, 2020

Are you sure that solves this issue? That pull request is for global shader uniforms, but this about rendering different environments with overriding materials.

@clayjohn
Copy link
Member

Ah, your right.

@clayjohn clayjohn reopened this Apr 17, 2020
@Calinou
Copy link
Member

Calinou commented May 27, 2020

Feature and improvement proposals for the Godot Engine are now being discussed and reviewed in a dedicated Godot Improvement Proposals (GIP) (godotengine/godot-proposals) issue tracker. The GIP tracker has a detailed issue template designed so that proposals include all the relevant information to start a productive discussion and help the community assess the validity of the proposal for the engine.

The main (godotengine/godot) tracker is now solely dedicated to bug reports and Pull Requests, enabling contributors to have a better focus on bug fixing work. Therefore, we are now closing all older feature proposals on the main issue tracker.

If you are interested in this feature proposal, please open a new proposal on the GIP tracker following the given issue template (after checking that it doesn't exist already). Be sure to reference this closed issue if it includes any relevant discussion (which you are also encouraged to summarize in the new proposal). Thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants