Spriter: Real-Time Sprite Imposter System

Discuss modding questions and implementation details.
User avatar
Kamer
Posts: 137
Joined: Mon Mar 05, 2018 9:26 pm

Re: Spriter: Real-Time Sprite Imposter System

Post by Kamer » Tue Dec 18, 2018 5:57 am

I'm gonna try and send you a mesh soon so you can try and see how it looks and works.

User avatar
MasonFace
Posts: 55
Joined: Tue Nov 27, 2018 7:28 pm
Contact:

Re: Spriter: Real-Time Sprite Imposter System

Post by MasonFace » Tue Dec 18, 2018 3:24 pm

Awesome! I'll create a new demo app with it so we can all see the results. I'm no good with shaders, but I may try to incorporate an oil painting shader to the final render pass of the sprite to keep true to your vision (I really like the way your HD baked sprites are looking).

User avatar
Kamer
Posts: 137
Joined: Mon Mar 05, 2018 9:26 pm

Re: Spriter: Real-Time Sprite Imposter System

Post by Kamer » Wed Dec 19, 2018 7:57 am

I'd at least have an option for the filter or not.

User avatar
King of Worms
Posts: 932
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow
Contact:

Re: Spriter: Real-Time Sprite Imposter System

Post by King of Worms » Wed Dec 19, 2018 8:17 am

Kamer wrote:
Wed Dec 19, 2018 7:57 am
I'd at least have an option for the filter or not.
Separate filtering option for sprites would be great, its usually present in this type of games with sprites, like brutal doom, heretic/hexen on zandronum engine etc

User avatar
MasonFace
Posts: 55
Joined: Tue Nov 27, 2018 7:28 pm
Contact:

Re: Spriter: Real-Time Sprite Imposter System

Post by MasonFace » Wed Dec 19, 2018 4:06 pm

I'd at least have an option for the filter or not.
Absolutely. The more options available to the user, the better in my opinion! The high level of customization is what I think makes this tool so interesting. I would like for each user to be able to fine tune their settings to get their sprites the way they think looks best.

I got a start on it last night. It is optional with a slider to modify the radius of the filter, but it's giving me some trouble.

I'm absolutely garbage when it comes to programming shaders, so I just copied the code for a Kuwahara shader from http://www.shaderslab.com/index.html. It works great when I apply this material to a quad with a static texture (with or without transparency) or to the main camera for a full screen post-processing effect, but when I use it on the camera that renders the 3D model into a render texture for the sprite's quad, it doesn't work correctly; It has a weird streaking effect as if the depth buffer isn't clearing each frame. It isn't very noticeable when the sprite's FPS is set low because the transparent parts are clearing after some amount of time, but when the sprite's FPS is set about midway or higher on the slider, the streaking looks really bad.

I'm not an expert on the matter, but I'm thinking that the render texture isn't clearing its depth buffer properly each frame but I don't understand why it's only happening with this shader applied to the sprite camera. I'm going to try to use GL.Clear when I get home this evening to try to force the depth buffer to clear itself each frame and see if that fixes it.

Interestingly, the shader also doesn't work correctly when applied to the quad that the render texture gets drawn onto, but it fails differently. I didn't fool with it for long, but if I remember correctly, the sprite didn't look like it was getting the filter applied and was transparent with some Z sorting issues on top of that... no idea what was going on, but it seemed like I was on the right track applying the shader to the sprite camera instead, so I'm going to continue to pursue that route.

User avatar
MasonFace
Posts: 55
Joined: Tue Nov 27, 2018 7:28 pm
Contact:

Re: Spriter: Real-Time Sprite Imposter System

Post by MasonFace » Fri Dec 21, 2018 2:28 pm

I got the Kuwahara (oil paint) shader finally working. I never could get it to work as a camera post-processing filter on the sprite camera, so I went back and added it to the sprite quad. All I had to do was override the render queue and it worked. The only problem now is that it doesn't work with screen space reflections, which I really want because it looks so cool. It looks like the Kuwahara shader I'm using isn't calculating normals, which I think would be required for the SSR to work. Shouldn't be too difficult to add to the shader- I'll just have to do some studying on it...

Also, I'm going to try to make a new demo scene designed to look like a Daggerfall interior just to put the tool in proper context.

Post Reply