Stencil or Mesh?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Relazy
Citizen
Posts: 51
Joined: Thu Jul 10, 2014 11:10 pm

Stencil or Mesh?

Post by Relazy »

Hello.

I have been working on a game (sort of an engine too) and during my development I have come forth a question of sorts:

Which is more efficient; Stencil or Mesh?

My editor for maps has the ability to add shapes and then to attach a texture to it, the image is reused across all other shapes that use the same image.

Currently I am using stencils to draw the images and then to crop them to the shape, I am considering using a Mesh to do the job instead as it might be more efficient than using a stencil per shape and looks more reasonable. Is it worth it to switch?

Also on the same topic, I have been having trouble with the texture co ordinates when creating the mesh, are there any good guides I can follow?
- Thanks
User avatar
micha
Inner party member
Posts: 1083
Joined: Wed Sep 26, 2012 5:13 pm

Re: Stencil or Mesh?

Post by micha »

I think you are correct. You can expect meshes to be faster than stencils. The stencil is attached to a stencil function and this function is run each time you set a stencil. That might take some time.

On the other hand, if you don't have performance issues with your current solution, then just keep it like it is. Don't optimize the performance of your game unless (1) it runs too slow and (2) you know why.
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 3 guests