SpriteManipulation

I was thinking maybe we could update the PImage class to include graphics rendered sprite tessalation.
Example:

Pimage texture = createImage(8, 8, ARGB);
PImage spritemap = loadImage("some.png");

texture.sampleSprite(spritemap, x, y);

void sampleSprite(PImage smap, int startx, int start y)
{

// Nested for loop texture.set(x, y, smap.get(startx, starty)); and so one. But makes a gpu call to run In parallel.

}

I was also thinking related to this,
It woulf be nice to have a livrary like peasycam
That assist in making custom gpu shaders. It not particularly difficult to write opengl shaders and vulkan shaders are the same thing, but implementing them more difficult

Maybe

PushMatrix()
translate(such and such);
rotate(around);
scale(thewall);

Shader.callVShader(vertex[x] somepoints)
{

vertx = vertex[x];

Vert = vertx * somestuff * matrix();


ShaderVertex(vert);

}

Shader.callPShader()
{

// Some cool math stuff;

ShaderPixel(color(somecolor));

}

Call it PeasyShader

1 Like

Your post has been edited to format the code for better readability. Please review our FAQ or refer to the animation below for guidance on posting code. Thank you!

ezgif.com-gif-maker (1)

Hey @JALAJ_0106! These ideas sound like a great fit for a library, which is the best way to extend Processing with new functionality. If you’re interested in contributing, we now have a new library template that makes it much easier to get started :smiley: Let me know if you’d like more details!

1 Like