Spriter: Real-Time Sprite Imposter System

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

Re: Spriter: Real-Time Sprite Imposter System

Post by Kamer »

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: 543
Joined: Tue Nov 27, 2018 7:28 pm
Location: Tennessee, USA
Contact:

Re: Spriter: Real-Time Sprite Imposter System

Post by MasonFace »

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: 583
Joined: Mon Mar 05, 2018 9:26 pm

Re: Spriter: Real-Time Sprite Imposter System

Post by Kamer »

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

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

Re: Spriter: Real-Time Sprite Imposter System

Post by King of Worms »

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: 543
Joined: Tue Nov 27, 2018 7:28 pm
Location: Tennessee, USA
Contact:

Re: Spriter: Real-Time Sprite Imposter System

Post by MasonFace »

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: 543
Joined: Tue Nov 27, 2018 7:28 pm
Location: Tennessee, USA
Contact:

Re: Spriter: Real-Time Sprite Imposter System

Post by MasonFace »

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.

HeadClot
Posts: 11
Joined: Wed Jul 29, 2015 9:11 am

Re: Spriter: Real-Time Sprite Imposter System

Post by HeadClot »

Hey is there any movement on this?

I would really like to use this :)

User avatar
MrFlibble
Posts: 410
Joined: Sat Jan 27, 2018 10:43 am

Re: Spriter: Real-Time Sprite Imposter System

Post by MrFlibble »

Having a crazy idea here, what about a programme that actually does the opposite, i.e. takes the animation angles of a character and builds a 3D model out of it?

User avatar
MasonFace
Posts: 543
Joined: Tue Nov 27, 2018 7:28 pm
Location: Tennessee, USA
Contact:

Re: Spriter: Real-Time Sprite Imposter System

Post by MasonFace »

MrFlibble wrote: Mon Feb 04, 2019 1:37 pm Having a crazy idea here, what about a programme that actually does the opposite, i.e. takes the animation angles of a character and builds a 3D model out of it?
I had thought about that before. I do eventually want to get into writing AI programs myself, but that's way over my head at this point. In the meantime, here is an AI program that may be able to: https://github.com/hiroharu-kato/neural_renderer

I may give it a shot later on. Unfortunately, it requires CUDA and doesn't support CPU at all.

Alternatively, I believe there are voxel approaches to this challenge, but I think they're all pretty crude.

Another option is photogrammetry, since we have multiple angles of the subjects, but I think most photogrammetry software requires more than 8 angles. Worth a shot though, and it looks like there are several free and open-source options available: https://all3dp.com/2/3d-print-from-photo-how-to-do-it/
HeadClot wrote: Sun Feb 03, 2019 12:15 pm Hey is there any movement on this?

I would really like to use this :)
I haven't had much time lately to work on it; I've been busy with working on the AI Upscaling project:https://forums.dfworkshop.net/viewtopic.php?f=14&t=1642

I've got a lot of issues fixed from the previous demo and have incorporated a 3D to 2D weapon canvas. Just have a few little bugs to fix before I release a new demo.

I am still debating on whether I want to try to sell this on the Unity asset store eventually, but I intend to allow those in the DFU community use it for their models, to be used exclusively in DFU, for free.

If you're wanting to use this tool for some other project, then I may still give you a copy if you can provide useful testing and feedback. If you're skilled with Unity and programming, and familiar with rendering techniques, then I'd feel more comfortable knowing that I'm not just going to get "It's not working good" as feedback. ;)

User avatar
jman0war
Posts: 315
Joined: Fri Jan 22, 2016 2:41 am
Contact:

Re: Spriter: Real-Time Sprite Imposter System

Post by jman0war »

Love it!
This is the one of the most exciting things on this project.

I wonder has anybody ever made contact with Theseus3000?
He had some amazing looking 3d enemies modeled and animated:
https://www.youtube.com/watch?v=sx-OMn6Wqdg
Find my Vibrant Terrain Flats mod at Nexusmods: https://www.nexusmods.com/daggerfalluni ... ?tab=files

Post Reply