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

Ability to produce geometry or passes from shaders/materials? #6868

Closed
Zylann opened this issue Oct 19, 2016 · 9 comments
Closed

Ability to produce geometry or passes from shaders/materials? #6868

Zylann opened this issue Oct 19, 2016 · 9 comments

Comments

@Zylann
Copy link
Contributor

Zylann commented Oct 19, 2016

Maybe the title is not clear enough, but I'll explain:

Multi-pass:
Coming from Unity, I saw it's possible to tell an object to render twice or more only from its shader. For example, it allows to implement 3D outlines easily (draw mesh a second time, but extrude along normals, reverse normals and put it on an opaque pass), perform fur shading by duplicating layers of geometry in parts needing that, or implementing other cool effects that cannot be done in another way.
In Godot, shaders don't go beyond being shaders in the strict term of it. They cannot tell how many passes it has to be rendered properly. Because of that, the node must be duplicated (and then processed twice), or a script has to be added, a self-contained material is not enough. Could such capability be considered in the future?

Geometry generation:
Going a bit further, possibly different area. I know it's possible today to generate geometry from shaders, and so not being forced to do it on the CPU, client-side towards the graphic card. For example, send a low-poly terrain on the graphic card, and subdivide it dynamically on the GPU (is tesselation the right word?). I know this is a fairly advanced topic and might not be supported by some graphic cards, but would it be possible to use it in Godot in the future?

@SuperUserNameMan
Copy link
Contributor

about multipass shader, just for reference : #4084

@vnen
Copy link
Member

vnen commented Oct 19, 2016

Also about multipass: #862.

@bojidar-bg
Copy link
Contributor

Would this be considered for 3.0?

@akien-mga akien-mga changed the title Discussion: ability to produce geometry or passes from shaders/materials? Ability to produce geometry or passes from shaders/materials? Jun 28, 2017
@ghost
Copy link

ghost commented Apr 7, 2018

First of all thank you for your report and sorry for the delay.

We released Godot 3.0 in January 2018 after 18 months of work, fixing many old issues either directly, or by obsoleting/replacing the features they were referring to.

We still have hundreds of issues whose relevance/reproducibility needs to be checked against the current stable version, and that's where you can help us.
Could you check if the issue that you described initially is still relevant/reproducible in Godot 3.0 or any newer version, and comment about it here?

For bug reports, please also make sure that the issue contains detailed steps to reproduce the bug and, if possible, a zipped project that can be used to reproduce it right away. This greatly speeds up debugging and bugfixing tasks for our contributors.

Our Bugsquad will review this issue more in-depth in 15 days, and potentially close it if its relevance could not be confirmed.

Thanks in advance.

Note: This message is being copy-pasted to many "stale" issues (90+ days without activity). It might happen that it is not meaningful for this specific issue or appears oblivious of the issue's context, if so please comment to notify the Bugsquad about it.

@Zylann
Copy link
Contributor Author

Zylann commented Apr 7, 2018

The part about geometry has a specific issue: #10817

Multipass miiight be solved by the next pass system in materials, however it's not available with ShaderMaterials for some reason.

@vnen
Copy link
Member

vnen commented Apr 7, 2018

It is available in ShaderMaterial (you have to set a shader before it appears):

screenshot from 2018-04-07 19-09-58

@ghost
Copy link

ghost commented Apr 9, 2018

@vnen that option disappears when loading shader from file. is it intentional?

Edit: apparently next_pass only works with spatial type ShaderMaterial. My shader file was canvas_item type.

@eon-s
Copy link
Contributor

eon-s commented Apr 9, 2018

Canvas item shaders and materials seems to not allow multiple passes, I have no idea if is intentional or not.

@akien-mga
Copy link
Member

Since geometry shaders are handled in #10817 and multi-pass is already supported, I think this issue can be closed. If other parts remain to be addressed, they're better served in a new issue opened against the master branch.

@akien-mga akien-mga added this to the 3.0 milestone Nov 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants