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

Custom vertex attribute default value is discarded if one of the field is changed #8790

Closed
Insality opened this issue Apr 12, 2024 · 2 comments · Fixed by #8853
Closed

Custom vertex attribute default value is discarded if one of the field is changed #8790

Insality opened this issue Apr 12, 2024 · 2 comments · Fixed by #8853
Assignees
Labels
bug Something is not working as expected engine Issues related to the Defold engine

Comments

@Insality
Copy link
Sponsor

Insality commented Apr 12, 2024

Describe the bug (REQUIRED)
For example we move the "tint" fragment constant to vertex attributes
Default value for tint : 1, 1, 1, 1

If we change the tint with
go.set(sprite, "tint.x", 0) - all values for tint will be 0

If we before that call the
go.set(sprite, "tint", vmath.vector4(1)) - all values will be as expected after set tint.x (0, 1, 1, 1)

Also this example is not working on Defold 1.7.1 Beta (I mean the sprites is not rendered with any params with this custom shader)

To Reproduce (REQUIRED)
Steps to reproduce the behavior:

  1. Load example
  2. Comment/Uncomment the lines to see the difference
	go.set(sprite, "tint", INIT_TINT)
	go.set(sprite1, "tint", INIT_TINT)
	go.set(sprite2, "tint", INIT_TINT)

Expected behavior (REQUIRED)
I have not to re-set the default values for vertex attribute
The example is not working in 1.7.1 (I mean the sprites is not rendered with any params with this custom shader)

Defold version (REQUIRED):
Reproduced on 1.7.0
Not worked in 1.7.1

Platforms (REQUIRED):
Tested on MacOS

Minimal repro case project (OPTIONAL):
vertex_attributes.zip

Workaround (OPTIONAL):
Set initial value for each sprite with that material

Screenshots (OPTIONAL):
Just screen from 1.7.0 from example:
Screenshot 2024-04-12 at 11 14 53

@Insality Insality added the bug Something is not working as expected label Apr 12, 2024
@britzl britzl added the engine Issues related to the Defold engine label Apr 15, 2024
@Jhonnyg
Copy link
Contributor

Jhonnyg commented Apr 25, 2024

This looks correct, right? I'll publish a PR with a fix for sprites soon

Screen.Recording.2024-04-25.at.16.02.46.mov

@Insality
Copy link
Sponsor Author

Yea, it's correct for this example!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working as expected engine Issues related to the Defold engine
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants