I have drawn the same polygon with a primitive and with draw_line. However, both are not aligned:
Related code here, it's a project with just one object with this draw code:
// code to see better the overlap
draw_set_alpha(.5)
gpu_set_blendmode(bm_add)
// draw a rectangle using surfaces...
I have a function to add a triangle to a vertex buffer...
function vbuff2d_triangle_filled_xy (trianglelistvbuff, xy_xy_xy, color, alpha) {
vertex_position(trianglelistvbuff, xy_xy_xy[0][0], xy_xy_xy[0][1]); vertex_color(trianglelistvbuff, color, alpha);
vertex_position(trianglelistvbuff...
Is it possible to draw a shape built from vertices, say, a circle, as an outline similar to draw_circle(x,y,outline) where outline = true without using a shader? I can't seem to locate a solution. If I render the vertices using pr_linestrip the lines connecting to the radial vertex are also...
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)...
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...
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...
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...
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 =...
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...
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]...
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...
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...
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?
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...
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...
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 +...
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)...
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...
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...
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...