Extend the ability of Sprite-Shaders

Discuss suggestions to improve the Axel library.

Extend the ability of Sprite-Shaders

Postby tharo » Thu Jun 27, 2013 11:58 pm

Playing around with Shaders I noticed that the 'shader' mechanism in AxSprite have some limitations.. that I would like to extend.

1.) Just one Texture is possible. But sometimes you want to use a second one at the shader.
I think a second Texture pointer would be nice. It dont think it have to be an array or Vector after all.
In AxSprite.draw() you can simply modify the code to add more textures if not null. And of course clean them afterwards.

2.) Then using the AxShader would make more sense and gives you more posibilitys. It would be nice to add two more Members to
AxShader. moreVertexValues:Vector<Number> and moreFragmentValues:Vextor<Number>. This -again- as the posibility to
pass more values to the shader. simply pass them, if not null, after the std values (matrix, uv)

So. Yeah. Atm AxSprite can take custom shader, but almost give no posibilitys to it. With this changes it would improove alot so I hope you agree to this suggestion :) As usual I offer to do the work and simply post the code/patch right here.
tharo
Corporal
 
Posts: 15
Joined: Fri Mar 29, 2013 4:31 am

Re: Extend the ability of Sprite-Shaders

Postby Arkeus » Fri Feb 21, 2014 8:38 pm

I think it makes more sense for you to subclass it and add a second texture, and overwrite draw(). Or if it's not really a sprite then subclass AxModel. AxSprite is a class that represents a sprite, and I think of a sprite as a quad and samples a single frame from a texture. Not much more than that. I don't think it makes sense for a sprite to have references to things it doesn't need, but that a subclass might.
Image
User avatar
Arkeus
Site Admin
 
Posts: 363
Joined: Mon Mar 26, 2012 12:43 am


Return to Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest

cron