primitives

  1. Erik Leppen

    Draw smooth lines? How to have "texture interpolation" for primitives?

    I have the idea that this should be very simple, but I can't find it. I'd like to have interpolation between pixels (with correct alpha blending of course, and using any color/alpha) for drawing primitives (draw_line, draw_circle, vertex_submit). Both for 1d (linelist) and 2d (trianglelist)...
  2. Tthecreator

    Legacy GM GM drawing acting in unexplainable ways

    Hi there! I was working on my UI asset and came across a weird bug I just cannot wrap my head around. I was making a function called draw_square_rounded_colour, which is a combination of draw_rectangle_colour and draw_roundrect. (draw_roundrect_colour only has 2 colors instead of 4). I...
  3. P

    Legacy GM Replacing a sprite on a texture page

    I'm working on a dungeon crawl-esque game, and I'd like to allow users to create entirely new content for it. To do that effectively, they need to be able to import sprites for their new items, enemies, terrain, et cetera. Terrain, though, poses a problem, since I'm using a primitive to render...
  4. A Random Creator

    GMS 2 Putting dents in a vehicle sprite

    Hello! So my problem is pretty simple, however to my knowledge takes a really complicated solution.. In my game I want the vehicles to be dented whenever they collide with a solid object, or get hit by a bullet or something. How I've done this is I made my sprite drawn through a primitive...
  5. E

    GML Drawing Distorted Texture Primitives - Texture Folds Wrong

    Please help me figure this out. My attempt at creating a surface-drawing script similar to draw_sprite_pos() has run into a snag. Here is the script: ///@description draw surface perspective ///@param x ///@param y ///@param surface ///@param distort ///@param squish var surface_id =...
  6. R

    Legacy GM A quick question of the efficiency of primatives?

    Hi Everyone! I was wondering if anyone had any insight into the efficiency / resource intensiveness of primitives? My current project involves drawing quite a few in various ways, alongside some other processes, so I'm just beginning to consider ways to keep my project streamlined to...
  7. Shadowblitz16

    GMS 2 draw pixel with primitives?

    how would I draw a pixel with primitives? I don't want to use draw_point because it is not scaled with the view this is what I have tried so far /// @description draw_point() /// @param color /// @param x /// @param y var _col = argument[0] var _x = argument[1] var _y = argument[2]...
  8. Erik Leppen

    GML vertex_begin and vertex_end: how are they best used?

    I want to create a set of scripts to draw vertex primitives more easily. So, I want to create a vertex buffer and then call some scripts to put shapes in them. So the idea is: Event code: //create vertex buffer //call script to add positions, colours etc. //call script to add positions, colours...
  9. Brenden

    Legacy GM Drawing Primitives, Transparency issue.

    So I am just normally drawing a textured primitive yet for some reason when two or more primitives overlap they become slightly transparent. I have not used any blending or alphas within any of the code. I am taking a view and pasting it to a surface and then make that surface into a texture to...
  10. D

    GMS 2 Drawing concave polygons

    I'm trying to fill a concave polygon using a triangle fan, but it seems it can only handle convex shapes. Is there a way to do it with built in functions, or do I have to triangulate the shape manually?
  11. Bingdom

    Shaders Making vertex buffers pixelated

    Hello GMC, So from my understanding, vertex buffers/ primitives are shot straight to the GPU. Ignoring all game resolutions and only using your monitor's display resolution. I know to get texture coords, it's v_vTexcoord. I'd like to know an equivalent or similar way to this. The problem I'm...
  12. D

    GMS 2 Rotating Textured Primitives

    I'm trying to come up with a method to draw arbitrary polygons with a texture so that the whole thing (shape and texture) can be rotated as one. The shapes will represent physics objects, similar to the ones in Super Sharp: I've already managed to draw an arbitrary polygon with a repeating...
  13. W

    [SOLVED] Repeating a texture when using primitives

    I'm using the following to render a texture to a primitive: draw_set_colour(c_white); draw_primitive_begin_texture(pr_trianglelist, sprite_get_texture(tSlope, 0)); draw_vertex_texture(x, y + sprite_height, 0, 1); draw_vertex_texture(x + sprite_width, y, 1, 0); draw_vertex_texture(x +...
  14. xDGameStudios

    Shaders Not really shaders (more primitives) [QUESTION]

    QUESTION:: how does: draw_vertex_texture_color() work when using "pr_trianglestrip" does just the last triangle gets coloured with the color/alpha from the vertex? why do I ask this? CONTEXT:: draw_primitive_begin_texture(pr_trianglestrip, s_texture); draw_vertex_texture(x1, y1, 0, 0)...
  15. G

    Optimising Primitives

    Okay so I've been making my own isometric engine which uses textured primitives to draw blocks and then surfaces to draw lighting on both horizontal and vertical surfaces and it looks pretty cool. My problem now is that when I draw more than about 10 blocks on screen at any one time my FPS...
  16. xDGameStudios

    GMS 2 Convert to vertex buffer (dynamically passing positional data to shader)

    I found this code in an asset in the marketstore (I'm using it here because I is free, and no credits are required so there should be no problem) I'm trying to learn something about shaders and vertexes... and primitives... and vertex buffers... so here is my question...
  17. G

    Legacy GM draw_vertex shenanigans [solved]

    So I made a hook for my game, and I wanted it to add some effects with the primitives. I added little sparkles around the hook, and also a chain. But since I added the chain code, everything went nuts! as you can see it keep drawing everything ( the hook sprite, the chain and the text which is...
  18. Jared Johnson

    3D SOLVED achieving depth with multiple d3d-primitives in one draw event

    Solved: I had some random drawing code in another object. Sorry for the mistake :V Lesson is: when implementing d3d, start by removing all drawing calls then introduce them in an organized fashion. EDIT: I"m having trouble recreating this problem in the FPS tutorial, soo i'll try and figure...
  19. G

    Shadow Blend Modes

    I am currently trying to add shadows to my game which are drawn using triangle strip primitives from the corners of boxes which cast shadows. This system is working well, however as I want the shadows to be 'see through' I am drawing these as black but with 0.3 alpha, this creates problems where...
  20. B

    Legacy GM Applying One Texture Across Multiple Faces?

    Hello, I've been using GM for several years now but this is my first time posting on the forum so forgive me if I make any mistakes here. My problem is thus, I'm creating a game in which I have a number of textures, like this: I need to resize one side of these textures so that it appears...
Top