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

Material used as next pass on multiple objects only affects one at a time #33049

Open
GlaceGwyneth opened this issue Oct 24, 2019 · 1 comment

Comments

@GlaceGwyneth
Copy link
Contributor

Godot version: 3.1 and 3.2 alpha1

OS/device including version: Windows 10; 10.0.18362 Build 18362

Issue description:
example

I have a pair of MeshInstances, each with their own separate material to start with (green sphere, blue cube) and a SpatialMaterial with the color red.
When I put this spatial material into the next pass slot of each MeshInstance's material, only one of them appears red at a time.

Giving multiple objects the same material resource behaves just fine normally, its just using next pass where this behavior appears...

Maybe this is some kind of intentional limitation, but it seems inconsistent to me, and is a hassle to deal with.

For example, I want to apply the same shader material, with the same uniform settings, to several different objects as an additional pass, but can't do so conveniently because of this. I would have to duplicate the material and individually set the uniforms for each of them. 😢

The example project puts the materials in the material slot of the MeshInstance, but the same thing occurs when placed in the mesh itself's material slot as well.
Only the editor view is necessary to show this, but it does happen when using a camera in the running game as well.

Minimal reproduction project: minimalrepro.zip

@Raphael2048
Copy link
Contributor

You can set your maaterial's priority to change materials' sort order

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.

3 participants