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

Manual Content: Document that draw_sprite_general gradients will not seamlessly span the whole rectangle #7394

Closed
rephaim1 opened this issue Aug 22, 2024 · 7 comments
Assignees
Labels
docs-bug GameMaker Manual Bugs

Comments

@rephaim1
Copy link

Description

Right side is wrong

I'd be happy to upload a yyz file but your fields are not allowing me. draw_sprite_general() has a problem.

I have uploaded an image to show how the shading appears.

On the lower right is perpendicular to the proper axis and causing a diagonal line to be drawn.

The square on the left has proper shading on the lower left corner.

This is one line of code that needs to have the function fixed. You have already rejected my first submission and I am supplying you with proof via an image.

There is a simple square sprite that is white and 64x64 that is being rendered at an x and yscale of 2.0. I have an obj_square and obj_sqaure_2 with this sprite assigned to them.

On the left side there is a draw_sprite_general(); statment shading the lower left.

On the right side there is a draw_sprite_general(); statement shading the lower right. <-- this causes the wrong style of shading.

Please try this for yourself and I have supplied more than enough to show that this is incorrect and needs to be addressed.

Benjamin Bausch.

Manual Link

http://127.0.0.1:51290/index.htm#t=GameMaker_Language%2FGML_Reference%2FDrawing%2FSprites_And_Tiles%2Fdraw_sprite_general.htm&rhsearch=draw_sprite_general&rhhlterm=draw_sprite_general

@rephaim1 rephaim1 added the docs-bug GameMaker Manual Bugs label Aug 22, 2024
@rephaim1
Copy link
Author

If there is a way for me to upload a yyz then please help me, instead of just closing my case and treating me poorly.

@stuckie
Copy link

stuckie commented Aug 23, 2024

You could attach a zip directly to the issue here, if you are happy with it being public.
Alternatively you can use the IDE bug reporter and it will attach it privately so only GameMaker staff can see it.

@stuckie stuckie self-assigned this Aug 23, 2024
@stuckie stuckie moved this from Triage to Backlog in Team Workload Aug 23, 2024
@attic-stuff
Copy link

attic-stuff commented Aug 23, 2024

this is not a bug, it's how vertex color works. see this comment i left on the other issue cause i am a dummy and didnt see this one.

@rephaim1
Copy link
Author

Draw Shadows.zip

Please see the attached.

@rephaim1
Copy link
Author

Maybe I'm not understanding. But it looks very odd to have the corners shaded differently.

@attic-stuff
Copy link

attic-stuff commented Aug 23, 2024

when you draw a sprite to the screen, whether through draw_sprite_general or through draw_self or some other function, that sprite is shown on screen as a texture that is spread across two triangles, always. each of those triangles is made out of three vertices, and those vertices contain data such as position and texture and also color. so for every sprite there are six vertices, two of which overlap at the top left and bottom right corners. each of the purple dots in this picture represent the location of a vertex in a sprite:

Capture

when you define the four colors in draw_sprite_general, you are giving each corner a color but this is still changing the color data of each of the six vertices. these colors do not interpolate (which is like making a gradient) across the rectangle, this is not possible using the hardware specification for the color attribute of a vertex because this is a color attribute that is calculated per vertex-of-a-triangle rather than per-pixel.

basically, this is not a bug, and this is not how to gpu handles vertex color. if you want that behavior you will have to use a custom shader and this is true of all game engines and all graphics apis.

@rephaim1
Copy link
Author

Understood. Thank you for your time and patience.

Benjamin.

@github-project-automation github-project-automation bot moved this from Backlog to Done in Team Workload Aug 23, 2024
@gurpreetsinghmatharoo gurpreetsinghmatharoo self-assigned this Aug 26, 2024
@gurpreetsinghmatharoo gurpreetsinghmatharoo moved this from Done to Todo in Team Workload Aug 26, 2024
@gurpreetsinghmatharoo gurpreetsinghmatharoo changed the title Re-submit for draw_sprite_general Manual Content: Document that draw_sprite_general gradients will not seamlessly span the whole rectangle Aug 26, 2024
@gurpreetsinghmatharoo gurpreetsinghmatharoo moved this from Todo to Ready for QA in Team Workload Aug 26, 2024
gurpreetsinghmatharoo added a commit to YoYoGames/GameMaker-Manual that referenced this issue Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs-bug GameMaker Manual Bugs
Projects
Status: Ready for QA
Development

No branches or pull requests

4 participants