Animated HUD

More
6 years 9 months ago #1 by DanP
Animated HUD was created by DanP
I would like to have a shader that displays on the screen a looping animated image. I have seen a thread around here with a shader that displays a regular PNG image overlay, and I tried it with a gif, however it did not animate. Is it possible?

Please Log in or Create an account to join the conversation.

More
6 years 9 months ago - 6 years 9 months ago #2 by Ganossa
Replied by Ganossa on topic Animated HUD
You are probably looking for something like this

reshade.me/forum/shader-discussion/162-l...v-blog?start=24#4782

You can find this Gr8mmFilm shader in CustomFX suite. It might already be everything you need. Checkout the texture it loads and replace its parts with your animated HUD pictures. (You might need to adjust a few values in the mediator if you change e.g. the amount of animated pictures)
Last edit: 6 years 9 months ago by Ganossa.
The following user(s) said Thank You: DanP

Please Log in or Create an account to join the conversation.

More
6 years 9 months ago #3 by DanP
Replied by DanP on topic Animated HUD
Thank you. But, this means I have to convert my gif into a really massive png? Is there no way to use the gif? It's video footage (with transparency), I would like it to be really high res and framerate

Please Log in or Create an account to join the conversation.

More
6 years 9 months ago #4 by Ganossa
Replied by Ganossa on topic Animated HUD
Crosire probably knows better but currently ReShade only supports 2D textures so no additional layers for a number of images. You might be able to add the alpha layer to a .dds texture though but I personally did not use .dds in ReShade yet (not sure it can also be read from other formats such as png).
In the worst case you need a texture for each frame (or a bundle as for the shader I wrote) plus the additional alpha layer/texture (or color it with a constant color that is not used for the UI and can therefore be filtered in the shader)
Since high quality usually contradicts with good performance, it might also be a good idea to identify effects in your image loop that can be done without sampling yet another stack of textures.
By the way, there are good compression tools for png so those files do not need to be massive :)
With proper blending you can also fake a proper framerate ;)
The following user(s) said Thank You: DanP

Please Log in or Create an account to join the conversation.

More
6 years 9 months ago #5 by DanP
Replied by DanP on topic Animated HUD
Alright, I'll make do with png. Thanks again. Great work on those shaders.

Please Log in or Create an account to join the conversation.

More
6 years 9 months ago #6 by DanP
Replied by DanP on topic Animated HUD
So I tried it and I couldn't get it to work, the transparency was off and I couldn't figure out how to automatically put all the images I needed in sequence into one image. Plus photoshop wouldn't let me make a bigger res than I needed. Do you think maybe a shader could do something like, point to a folder full of PNGs and, according to filename, display each one of them in sequence?

Please Log in or Create an account to join the conversation.

More
6 years 9 months ago #7 by crosire
Replied by crosire on topic Animated HUD

Do you think maybe a shader could do something like, point to a folder full of PNGs and, according to filename, display each one of them in sequence?

No. That would be way too many textures to load and the amount of samplers required to sample them cannot be handled by GPUs, nor would it make sense performancewise. Putting everything into one texture works, using multiple textures for this would be insane.

Please Log in or Create an account to join the conversation.

More
6 years 9 months ago #8 by DanP
Replied by DanP on topic Animated HUD
Are you sure? Currently I'm using an old program that does something similar, called Custom Desktop Logo, it's loading a folder of about 200 pngs @1mb each and animating it at 30 fps, the performance impact is negligible. Why can't a shader do this?

Please Log in or Create an account to join the conversation.

More
6 years 9 months ago - 6 years 9 months ago #9 by kingeric1992
Replied by kingeric1992 on topic Animated HUD
You can't load all the textures in a shader at once, there are hardware(TMUs) and api limits.
and you didn't need to, luciferhawk already made some old TV effect that uses texture atlas which in some way is animated HUD.
Last edit: 6 years 9 months ago by kingeric1992.

Please Log in or Create an account to join the conversation.

More
6 years 9 months ago - 6 years 9 months ago #10 by crosire
Replied by crosire on topic Animated HUD

Are you sure? Currently I'm using an old program that does something similar, called Custom Desktop Logo, it's loading a folder of about 200 pngs @1mb each and animating it at 30 fps, the performance impact is negligible. Why can't a shader do this?

That program is entirely CPU based (as almost every desktop application). The GPU has a !completly! different architecture than the CPU. It only has a limited number of sampler registers from which a shader can sample a texture. Each access to one such register is a demanding operation, so those should be kept low and one should always sample from memory which is close to each other to utilize the cache best. Switching textures in those samplers is another demaning operation and can not be done in the middle of executing a shader (obviously). This is why you would always put everything you need in the same memory region, which means one texture with all the data.
Last edit: 6 years 9 months ago by crosire.
The following user(s) said Thank You: DanP

Please Log in or Create an account to join the conversation.

More
6 years 9 months ago #11 by DanP
Replied by DanP on topic Animated HUD
Alright, thanks for the clarification.

Please Log in or Create an account to join the conversation.

More
6 years 9 months ago - 6 years 9 months ago #12 by DanP
Replied by DanP on topic Animated HUD

You can't load all the textures in a shader at once, there are hardware(TMUs) and api limits.
and you didn't need to, luciferhawk already made some old TV effect that uses texture atlas which in some way is animated HUD.

And I tried that shader, and ran into too many hurdles for what I tried to do. The biggest would be, how would I automatically insert hundreds of full res images, vertically, in a specific order into one static png?
Last edit: 6 years 9 months ago by DanP.

Please Log in or Create an account to join the conversation.

More
6 years 9 months ago - 6 years 9 months ago #13 by kingeric1992
Replied by kingeric1992 on topic Animated HUD
This??
www.photojoiner.net/
I'm sure there are a lot of other programs capable of stitching pics together.

you still need to set the grid size in shader.
Last edit: 6 years 9 months ago by kingeric1992.

Please Log in or Create an account to join the conversation.

More
6 years 9 months ago #14 by DanP
Replied by DanP on topic Animated HUD
I've tried it, that site converts the image to jpg. It has to be png, for transparency.
I searched quite a bit for programs/ways to do this. I'm sure they exist but I just couldn't find them.

Please Log in or Create an account to join the conversation.