SRB2 Message Board  

Go Back   SRB2 Message Board > Sonic Robo Blast 2 > Releases > Software

Reply
 
Thread Tools
Blender template for rendering SRB2 sprites Details »»
Blender template for rendering SRB2 sprites
Version: 1.1, by flarn2006 flarn2006 is offline
Developer Last Online: May 2020

Version: SRB2 Rating: (2 votes - 3.80 average)
Released: 05-05-2020 Last Update: Never Installs: 6
Re-Useable Content

I created this as an alternative to drawing each angle of a sprite manually. If you're skilled with 3D modeling, you can use this template to create (what I think are) pretty decent looking sprites for SRB2.



Included is the .blend file, instructions for using it, and a demo WAD, so you can see the area from the above screenshot in-game. Note that the color is different in the screenshot because the example model uses a material designed to render using only colors in the skin color range.

I hope you find this helpful!

Download Now

File Type: zip SRB2Blender.zip (135.1 KB, 165 views)

Screenshots

Click image for larger version

Name:	screenshot.jpg
Views:	1481
Size:	111.5 KB
ID:	30779  

Show Your Support

  • The author of this addon has given explicit permission for its content to be re-used and/or reproduced.

Comments
Old 05-06-2020   #2
Zipper
Killda
Judge
 
Zipper's Avatar
Default

I had heard of Blender adding support for pixel-art shading, but I never thought it would look this spicy. With enough patience, I bet people can even churn out full character wads that actually look really nice! ...or they can just update Sonic's Schoolhouse to 2.2 standards. Anyway, huge fan of this.

Additionally, for python-savvy people, this attachment allows you to rename exported sprites quickly, provided you exported them with the intended 4 letter prefix. "python nameswap.py <prefix> <anglecount>".
Attached Files
File Type: zip nameswap.zip (562 Bytes, 29 views)
__________________
Quote:
<Rob> Thok is not malaria
Zipper is offline   Reply With Quote
Old 05-06-2020   #3
PT.
It's the Sour Hour.
 
PT.'s Avatar
Default

I'm really excited about this development! I can already see some cool stuff coming from this tool, perhaps a rendered character that doesn't look like it came straight out of a bootleg SNES game. Good stuff!

Quote:
Originally Posted by Zipper View Post
...or they can just update Sonic's Schoolhouse to 2.2 standards.
You know you want it.
PT. is offline   Reply With Quote
Old 05-06-2020   #4
flarn2006
Default

Thanks for the script!

And yeah, I was also surprised how well it turned out. BTW, here's something I made as a test. Feel free to use it if you want.
Attached Thumbnails
Click image for larger version

Name:	anim.gif
Views:	42
Size:	21.9 KB
ID:	30800  
flarn2006 is offline   Reply With Quote
Old 05-06-2020   #5
Ace Dragon
 
Ace Dragon's Avatar
Default

I have used Blender for 15 years now so this is right in my wheelhouse. I only had to add the .blend file to my ever growing number of scenes (in its own folder to separate it of course).

Allow me to suggest a little optimization for the presentation, Blender has a text editor, so you could've put the instructions in as a text datablock. I took a look at the setup and everything appears to be fairly straightforward. To others here, I would recommend going through the official docs. first if you're just starting with 3D, Blender 2.8x has made strides in ease-of-use, but a DCC app. by its nature will be more complex than your favorite spriting software.

Last edited by Ace Dragon; 05-06-2020 at 09:45 PM.
Ace Dragon is offline   Reply With Quote
Old 05-06-2020   #6
flarn2006
Default

Quote:
Originally Posted by Ace Dragon View Post
I have used Blender for 15 years now so this is right in my wheelhouse. I only had to add the .blend file to my ever growing number of scenes (in its own folder to separate it of course).

Allow me to suggest a little optimization for the presentation, Blender has a text editor, so you could've put the instructions in as a text datablock. I took a look at the setup and everything appears to be fairly straightforward. To others here, I would recommend going through the official docs. first if you're just starting with 3D, Blender 2.8x has made strides in ease-of-use, but a DCC app. by its nature will be more complex than your favorite spriting software.

I considered doing that, but decided against it because it could be tricky to explain how to close the text window. Having a separate file is easy enough.
flarn2006 is offline   Reply With Quote
Old 05-06-2020   #7
Prime 2.0
Grape flavored
 
Prime 2.0's Avatar
Default

Makes me wonder - would it also be possible to have this automatically output an MD3 with the animations in it, and accompanying models.dat line so you get a model for openGL to use alongside the prerender?

It's a small thing, perhaps, considering you'd already have the model and animations in the first place to use this tool, but it'd sure be convenient to just have it do the conversion for you at the same time.
__________________
Science tells us that nothing can be proven, only rendered more likely to be true. If we do not question what we already know, how can we know, much less admit, when we're wrong? Such things are vital to progress.

Last edited by Prime 2.0; 05-06-2020 at 10:18 PM.
Prime 2.0 is offline   Reply With Quote
Old 05-06-2020   #8
flarn2006
Default

Not sure, might be possible.


Also, I was experimenting with the outline effect, and figured out how to get it to apply based on changes in depth, not just edges. Which do you think looks better?

Original on left, newer version on right:





The difference is most apparent on this frame:





I've attached that version of the Blender project file (in SRB2-v1.1a.zip) in case you want to experiment with it; see the Compositing tab at the top.
Attached Thumbnails
Click image for larger version

Name:	before.gif
Views:	1295
Size:	25.5 KB
ID:	30826   Click image for larger version

Name:	after.gif
Views:	1296
Size:	29.1 KB
ID:	30827   Click image for larger version

Name:	ss_0001.png
Views:	1300
Size:	4.2 KB
ID:	30828  
Attached Files
File Type: zip SRB2-v1.1a.zip (132.7 KB, 33 views)

Last edited by flarn2006; 05-06-2020 at 10:54 PM.
flarn2006 is offline   Reply With Quote
Old 05-07-2020   #9
Ace Dragon
 
Ace Dragon's Avatar
Default

Quote:
Originally Posted by flarn2006 View Post
Not sure, might be possible.
Python should give you what you need to create an addon that encodes an animated model to the .md3 spec. (as there have been many exporters created for Blender over the years).

I do not know how the spec. works myself so I can't help with that, but it shouldn't be as complex as various modern formats like Alembic, USD and GlTF.
Ace Dragon is offline   Reply With Quote
Old 05-08-2020   #10
Ace Dragon
 
Ace Dragon's Avatar
Default

Been working at that setup, and I think being able to use Blender to create sprite assets will be a huge deal, especially if you want to make those newly supported 16-directional ones like seen here.
Click image for larger version

Name:	LWZ-GIF9.gif
Views:	136
Size:	7.88 MB
ID:	30873

This is especially so if you want your custom sprite objects animated, an asset that potentially means days of pixel pushing (with many revisions) can now be done in just one or two hours (with few revisions).

I also have a clock asset with 3 frames for a total of 48 unique sprites total. If you upgrade an asset from 8 directions, it actually takes longer to tweak the names so they are correct.
Ace Dragon is offline   Reply With Quote
Old 05-08-2020   #11
softchassis
 
softchassis's Avatar
Default

Quote:
Originally Posted by flarn2006 View Post

I definitely feel like the one on the right is the way to go. Compare it to how Sonic's middle head spike is drawn from the back--it's got a visible outline. That aside I feel like the depth is more apparent in the sprite on the right. The one on the left looks more like it could be a lollipop or a green disc rather than the back of something longer.
softchassis is offline   Reply With Quote
Old 05-08-2020   #12
Prime 2.0
Grape flavored
 
Prime 2.0's Avatar
Default

Something else to consider is that the example output, that arrow sign, has a stylistic inconsistency with the rest of SRB2 in how it's not taking into account vertical perspective. A lot of older sprites did a purely orthographic perspective, but stuff has moved away from that a lot, especially in 2.2 - nowadays things are generally sprited with an eye for where they'll vertically be relative to the default camera, which you can especially see with the new spring sprites compared to the old ones.

But mostly, the stand-out thing is that the base of that pole is just a straight horizontal line instead of being curved down into a cylinder.

Basically, you may need to add in some options to tweak how perspective works, especially vertical perspective - where it's centered, etc.

Or maybe I'm just completely off my rocker about what's actually happening there and the pole's base lacks perspective for some completely different reason, lmao.
__________________
Science tells us that nothing can be proven, only rendered more likely to be true. If we do not question what we already know, how can we know, much less admit, when we're wrong? Such things are vital to progress.

Last edited by Prime 2.0; 05-08-2020 at 06:53 PM.
Prime 2.0 is offline   Reply With Quote
Old 05-08-2020   #13
flarn2006
Default

Have you tried moving the camera up and down? It mentions that in the readme. That's what you're talking about, right?
Actually, your specific example, about the base being a straight line, seems to just be an artifact of the render resolution. It appears curved in Blender from the camera view (press 0 on the numpad to see) but it doesn't render that way because it's too shallow of a curve.
I think I set the focal length much too high, at 170mm. Here's what it looks like after changing it to 50mm (and moving the camera closer to compensate.)
Attached Thumbnails
Click image for larger version

Name:	50mm.gif
Views:	970
Size:	27.7 KB
ID:	30901  

Last edited by flarn2006; 05-08-2020 at 11:15 PM.
flarn2006 is offline   Reply With Quote
Old 05-11-2020   #14
TheRealBrowne456
 
TheRealBrowne456's Avatar
Default

Can you create a video tutorial for people who are better at learning visually? Thanks!
TheRealBrowne456 is offline   Reply With Quote
Old 2 Days Ago   #15
Ace Dragon
 
Ace Dragon's Avatar
Default

Just an update on my use, I began looking at the Python script to automatically rename objects already rendered and I found it apparently does not work with the latest builds of Blender 2.90, so I ended up rewriting much of the script and now it looks like this. It is doing names for a custom 16-directional animated custom crawla object (base name YOSS) as an example. Do note the filepath was altered slightly for privacy purposes.
Code:
import os, sys
import math
from pathlib import Path

pref = "YOSS"
angcount = 16

target = Path('C:/Users/-----/Documents\Blender texture image stuff\Textures\Textures\Low-fi\Sprites\YellowCrawla')
dirs = os.listdir(target)

letterdict = dict({
    1: ["0"],
    5 : ["1","28","37","46","5"],
    8 : ["1","2","3","4","5","6","7","8"],
    9 : ["1", "9G", "28", "AF", "37", "BE", "46", "CD", "5"],
    16 : ["1", "9", "2", "A", "3", "B", "4", "C", "5", "D", "6", "E", "7", "F", "8", "G"]
})

startchar = 'A'

for file in dirs:
    if file.startswith(pref):
        
        imagenumber = dirs.index(file)
        letters = list(letterdict[16])
        suffix = letters[int(imagenumber%16)]
        
        if imagenumber == 16:
            startchar = 'B'
        elif imagenumber == 16*2:
            startchar = 'C'
        elif imagenumber == 16*3:
            startchar = 'D'
        elif imagenumber == 16*4:
            startchar = 'E'
        elif imagenumber == 16*5:
            startchar = 'F'
        elif imagenumber == 16*6:
            startchar = 'G'
        elif imagenumber == 16*7:
            startchar = 'H'
        elif imagenumber == 16*8:
            startchar = 'I'
        elif imagenumber == 16*9:
            startchar = 'J'
        elif imagenumber == 16*10:
            startchar = 'K'
        elif imagenumber == 16*11:
            startchar = 'L'
        elif imagenumber == 16*12:
            startchar = 'M'
        elif imagenumber == 16*13:
            startchar = 'N'
        elif imagenumber == 16*14:
            startchar = 'O'
        elif imagenumber == 16*15:
            startchar = 'P'
        elif imagenumber == 16*16:
            startchar = 'Q'
        elif imagenumber == 16*17:
            startchar = 'R'
        elif imagenumber == 16*18:
            startchar = 'S'
        elif imagenumber == 16*19:
            startchar = 'T'
        elif imagenumber == 16*20:
            startchar = 'U'
        elif imagenumber == 16*21:
            startchar = 'V'
        elif imagenumber == 16*22:
            startchar = 'W'
        elif imagenumber == 16*23:
            startchar = 'X'
        elif imagenumber == 16*24:
            startchar = 'Y'
        elif imagenumber == 16*25:
            startchar = 'Z'
        elif imagenumber >= 16*26:
            print('too many frames')
                    
        targetpath = os.path.join(target,os.path.relpath(file))
        
        newname = pref+startchar+str(suffix)+str('.png')
        newpath = Path(str(target)+("/")+str(newname))
        print(newpath)
        
        if not os.path.exists(newpath):
            os.rename(targetpath,newpath)
        else:
            print('file already exists, doing nothing')
It was nice to see when the game accepted the 176 images it renamed, so getting them ready was just a few button clicks in SLADE. I even fixed a couple of warnings since there was apparently a mistype or two the first time around. This will be really important if I was to ever start reskinning the bosses (which would have a lot more images).
Ace Dragon is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:56 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.