MasonDoran
01-23-2003, 02:24 PM
on Highend there around 5 or 6 different kinds of toon shaders and there is also inkworks that renders direct to swf.
Swiffworks sucks because cuz you cant use any proper lighting information...just a flat shade with an outline that does not vary in line weight. Inkworks is better cuz you get lighting information....but the renderer bites cuz it produces a lot of errors in the render...seems to be a problem with reading the z depth.
The toonshaders on highend are nice but you dont get any .swf output.....and i wanted to do something natively in 4.5. So here is what i did AND get output to .swf.
Swf works best when you use toon shader type graphics....and Flashes Trace Bitmap function is the best on the market...its both very fast and accurate.
Create 2 rampshaders....one for color information: Interperolation set to Linear, and color input set to brightness. Play wth the colors you want.
The second Rampshader is for the line: In the incandescence slot....set interpolation to none, add a white color swatch....and drag to around the middle...this will decide the thickness of the line. Black on the left...and white on the right.
Now create a Layered Shader....hook up the rampshader for the line on the far left so it is on top....and the colored rampshader so it is on the right. Set the composite flag to layered texture. Now connect the Line Rampshader to its own transparency slot in the Layered Shader....this is so it will render only the black line on top of colored rampshader and not the white.
Now test away....get the line the way you like it....and the colors so they look good. Once you are ready to render...you will need to make 2 passes....one for color information...and one with the line information....and then composite in Flash using the trace bitmap. It is easy to do, just render the color information by flipping the order of the shaders in the layered shader and changing the composite flag to Layer Shaders.
Its very import to render out as TGA format so you can convert to PNG format to preserve the Alpha Mask in Flash(flash doesnt support tga)
Now import the 2 passes on 2 seperate layers....then trace bitmap. I found the corner threshold set to normal and the curve fit set to smooth is a nice setting.
At this point...make sure the line layer is on top...and that you delete all of the white......and then merge the layers.
This method is a little bit of work....but is more accurate then Inkworks...you get a better line...and it is more accurate.
Swiffworks sucks because cuz you cant use any proper lighting information...just a flat shade with an outline that does not vary in line weight. Inkworks is better cuz you get lighting information....but the renderer bites cuz it produces a lot of errors in the render...seems to be a problem with reading the z depth.
The toonshaders on highend are nice but you dont get any .swf output.....and i wanted to do something natively in 4.5. So here is what i did AND get output to .swf.
Swf works best when you use toon shader type graphics....and Flashes Trace Bitmap function is the best on the market...its both very fast and accurate.
Create 2 rampshaders....one for color information: Interperolation set to Linear, and color input set to brightness. Play wth the colors you want.
The second Rampshader is for the line: In the incandescence slot....set interpolation to none, add a white color swatch....and drag to around the middle...this will decide the thickness of the line. Black on the left...and white on the right.
Now create a Layered Shader....hook up the rampshader for the line on the far left so it is on top....and the colored rampshader so it is on the right. Set the composite flag to layered texture. Now connect the Line Rampshader to its own transparency slot in the Layered Shader....this is so it will render only the black line on top of colored rampshader and not the white.
Now test away....get the line the way you like it....and the colors so they look good. Once you are ready to render...you will need to make 2 passes....one for color information...and one with the line information....and then composite in Flash using the trace bitmap. It is easy to do, just render the color information by flipping the order of the shaders in the layered shader and changing the composite flag to Layer Shaders.
Its very import to render out as TGA format so you can convert to PNG format to preserve the Alpha Mask in Flash(flash doesnt support tga)
Now import the 2 passes on 2 seperate layers....then trace bitmap. I found the corner threshold set to normal and the curve fit set to smooth is a nice setting.
At this point...make sure the line layer is on top...and that you delete all of the white......and then merge the layers.
This method is a little bit of work....but is more accurate then Inkworks...you get a better line...and it is more accurate.
