Mantis

View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0018170Runner3DPublic2015-06-06 12:532017-08-04 14:06
Reporterxot 
Assigned ToMike Dailly 
PriorityLowSeverityC - GeneralReproducibility100%
StatusClosedResolutionFixed 
PlatformWindowsOSWindow 8.1OS Version64-bit Home
Summary0018170: image_index rounds differently depending on context
DescriptionWith normal sprite drawing functions, image_index is floored when selecting a sprite subimage to draw.

With texture functions, image_index is rounded to the nearest integer when select a sprite subimage to reference.

With shader functions, image_index is sometimes rounded to the nearest integer when selecting a sprite subimage to reference. It appears to behave differently depending on if the sprite occupies more than one texture page. This may be due to the GGS texture page size setting or the "Used for 3D" setting.
Steps To ReproduceIn the attached example, a "1" or a "2" appear depending on the rounding of image_index which is set to a value of 0.55.

In the top portion, the left is drawn with draw_self() and the right is drawn using a primitive textured by the current sprite and subimage settings.

In the lower portion, a shader is used to draw the current sprite and subimage. A "1" appears in the red channel when the shader references gm_BaseTexture and a "2" appears in the blue channel when the shader uses a staged textures which is set to display the same image.

If the GGS texture page size is increased so that the sprite occupies only one page, the shader functions as expected.

Workaround: Always use floor(image_index) for operations which require a sprite subimage.
Additional InformationOnly Windows and Windows (YYC) have been tested. HTML5 failed to run under Chrome.
1.4 Version1.99.402
2.x Runtime Version
2.x Runtime Version Verified In
Attached Files? file icon image_index.gmz [^] (1,179,251 bytes) 2015-06-06 12:53
png file icon Screenshot 2015-06-06 08.03.02.png [^] (13,330 bytes) 2015-06-06 13:05

- Relationships

-  Notes
(0037711)
xot (Updater)
2015-06-06 12:53
edited on: 2015-06-06 12:53

Related: #0016388

(0037712)
xot (Updater)
2015-06-06 13:14

Function sprite_get_tpe(sprite, index) should probably be looked at. I don't know how to use it so it was not tested.
(0052866)
Mike Dailly (Manager)
2017-04-21 14:37

fixed - all display 1 on windows (GMS2) and HTML5


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker