-
Notifications
You must be signed in to change notification settings - Fork 8
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
Comments
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. |
You could attach a zip directly to the issue here, if you are happy with it being public. |
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. |
Please see the attached. |
Maybe I'm not understanding. But it looks very odd to have the corners shaded differently. |
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: 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. |
Understood. Thank you for your time and patience. Benjamin. |
…eamlessly span the whole rectangle YoYoGames/GameMaker-Bugs#7394
Description
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
The text was updated successfully, but these errors were encountered: