-
-
Notifications
You must be signed in to change notification settings - Fork 452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gif player #2833
base: master
Are you sure you want to change the base?
Gif player #2833
Conversation
Thanks for the pull request! Cool idea! I'm wondering if there is an open source Gif loader library out there that we could use instead of implementing the intricacies ourselves, thinking from a future maintainability and security perspective. |
Great. But I think you should use the new Lua parser. |
yeah we can |
😔 |
Do we really need this? |
actualy, no. If you for example want to have gif in mta, i bet there is a program that can turn it into atlas texture with every frame. |
Keep in mind that GIF is not just a collection of pictures displayed one after the other. GIF allows you to set pauses between frames and other things. If such GIF is directly converted to a png set, then the size of the textures will be much MUCH larger. |
Probably along with frames you can use some tool to extract metadata. |
Me personally prefer to use Rive and Spine. But how about not very experienced deveopers? Of course this means that just no one will use animations, and therefore the interfaces will look less interesting than they could be. |
well then you won't be able to use shaders to control the texture pixels local gif = gifCreate("label.gif");
local shader = dxCreateShader("shader.fx");
assert(shader, "couldn't create the shader!");
dxSetShaderValue(shader, "gif", gif);
addCommandHandler("startanim", function()
gifPlay(gif);
);
addCommandHandler("stopanim", function()
gifStop(gif);
end);
addCommandHandler("setlabel", function()
-- engineApplyShaderToWorldTexture ...
end); texture gif;
sampler2D gifSampler{
Texture = gif;
};
float4 pixels(float2 coords : TEXCOORD0) : COLOR0 {
// and for example i want to remove green background here
float4 color = tex2D(gifSampler, coords);
if (color == float4(0, 1, 0, 1)) {
return (float4)0;
}
return color;
}
technique Render{
pass p0 {
PixelShader = compile ps_2_a pixels();
}
} this feature has less fps drop than the render target or other possible methods |
The shader idea is kinda cool, I can see myself using it. I would use it to display some forum avatars aswell.
|
actually i was thinking about playing videos on mta client
you know i don't want to open another application in my computers background and create other vm s to display a simple gif |
hi
i made a gif player which load and play gifs as fast as possible
you can create a gif like:
cuz it is a texture element you can use it, inside shaders or inside all dx related functions