Cell Shading in TGB
by Trajian · in Torque Game Builder · 05/15/2009 (2:24 am) · 10 replies
I understand cell shading is possible in a 3D environment, and without knowing much about it this question is a very uneducated guess, but is it possible in a 2D environment, such as created with TGB Pro?
The reason I ask is because I am working on a small game to try to understand the engine before getting into a big project. Imagine a mix between Mario and Maplestory, but I am trying to achieve graphics as the same feel as Fiesta, only in a 2D environment.
Sorry if all this is confusing. Haha.
Thanks in advanced,
Trajian
The reason I ask is because I am working on a small game to try to understand the engine before getting into a big project. Imagine a mix between Mario and Maplestory, but I am trying to achieve graphics as the same feel as Fiesta, only in a 2D environment.
Sorry if all this is confusing. Haha.
Thanks in advanced,
Trajian
#2
now, how to apply CellShading in real time in TGB i've no idea.
05/15/2009 (11:14 am)
in the project i recently made, we did just that, made the models with XSI, pre-rendered them, and then took pics of the models to use them as sprites on TGB.now, how to apply CellShading in real time in TGB i've no idea.
#3
05/15/2009 (12:20 pm)
If it uses openGL I'd think changing the rendering code to display cel shaded models would work. Probably just editing the code in T2D/t2dShape3D.cc could do the trick.
#4
05/15/2009 (12:40 pm)
problem is that in TGB, you mostly work with sprites, not with poly models... but well, i dont know much about how to apply cell shading effects so, i better shut up.
#5
05/15/2009 (12:54 pm)
Well the sprites in TGB are actually flat polygons with a texture drawn on them, from what I understand. TGB is more of a 3D engine than true 2D.. We already have the code to draw models in there. All you would do is change that rendering code to draw a cel shaded model. I wish I had time to experiment and possibly do it but I barely get to code as it is lately :/
#6
The workaround that I and others have used so far is to render your tiles at various blended levels. For instance, I have one spritesheet, then rendered it again for spritesheet_red, spritesheet_blue, spritesheet_green. Once for each shaded color that I'll be swapping out in the tiles. You could do the same thing for opacity or brightness.
05/15/2009 (1:04 pm)
It can't be done without modifying the C++ code.The workaround that I and others have used so far is to render your tiles at various blended levels. For instance, I have one spritesheet, then rendered it again for spritesheet_red, spritesheet_blue, spritesheet_green. Once for each shaded color that I'll be swapping out in the tiles. You could do the same thing for opacity or brightness.
#7
05/18/2009 (11:43 am)
You could also render 2 sprites for every 1 sprite you need (do this dynamically in code). Then, in code, have the actual sprite be in front of the second. Make the second a little bit larger than the original sprite (uniform sizing), and modify its blending colors to be 0,0,0. Now you don't need any additional sprite sheets, don't need to worry about adding a black outline to all your images - the code will handle it all for you. Though keep in mind that this will effectively double the amount of objects on your screen at all times.
#8
I rendered my player aircraft in 3D with flat cell shading and a black outline, and then stored it in a 2D spritesheet.
05/19/2009 (1:48 am)
Check out my game droneswarm (http://droneswarm.com)I rendered my player aircraft in 3D with flat cell shading and a black outline, and then stored it in a 2D spritesheet.
#9
05/20/2009 (11:18 am)
hey Conor, what you said was what i suggested, havin your models render with the CellShading effect and then make your sprite sheets with that... cuz i think (out of my ignorance) that doing that directly on the engine, would be a lil CPU expensive.
#10
Sorry for the late response though, I have been in Arizona rock climbing lately. :D
05/21/2009 (11:59 pm)
I greatly appreciate all the comments about this topic, I will play around with a few ideas you guys said previously and see if i get anything working. I may just render it with the cell shading effect and make the sprite sheet like Casas and Conor suggested. Sorry for the late response though, I have been in Arizona rock climbing lately. :D
Torque 3D Owner Chris Jorgensen
Cascadia Games LLC