AuthorTopic: [Tool] 3D to 2D Blender Pixel Shader  (Read 22305 times)

Offline Conzeit

  • 0100
  • ***
  • Posts: 1448
  • Karma: +3/-0
  • Camus
    • conzeit
    • View Profile
    • CONZEIT

Re: [Tool] 3D to 2D Blender Pixel Shader

Reply #10 on: February 19, 2015, 04:16:37 pm
I'm glad you think it can be done (freestyle? you mean no extra coding?) in blender.

LOL it'd be pretty funny to have someone fight with an anvil XD dunno what I was thinking.

The artist made ambient occlusion on the R channel of vertex (that's what I was confusing with normal maps, probably because it's displayed as a grayscale texture :p) is what interests me most, this one trick is what takes this game from regular crappy fake celshading to something that can really stand next to hand drawn celshading.
Not sure about the ambient occlusion they store on G channel, self-shadowing tends to help bring volume, for example look at later KOF sprites. XI does it a lot
Quote
Vertex normals are adjusted to simplify the light response and eliminate small scale polygonal shadows. Apparently the export from Softimage to UE3 automatically regenerated normals so they had to rewrite it. Faces were adjusted by hands, other parts by transferring normals from proxy objects, with the examples of Sol's pants or character hair in general.
I dont really understand this part but I *think* "simplify the light response and eliminate small scale polygonal shadows" means they're eliminating more micro-self shadowing? this seems smart if it helps create the celshading they did.

The line thickness variation is great  (at alpha channel of vertex?), I would've probably exagerated it more. Specially interesting is the part that they map the how much it scales with the camera (green channel of vertex) All sorts of scaling with camera seem very pixel relevant, just like smaller res sprites tend to have bigger heads to fit expressions (that they swap to more super deformed head models on zoom out sems relevant too).

Quote
Basically on a lit surface the response will be something like (light color + ambient color) * texture color, while in shadow the response is ambient color * texture color * SSS color, so you can tint the shadows.
Defining shadow color defintively seems useful what with all our hueshifting and all.

I'm just now realizing that the gradient map of this 2dBlender Pixel shader plus this trick for defining shadow color would be really cool, you get  two ramps for the shading to go down.

Very much like the Street Fighter 3 faking of ambient lights.

look at how on the lit parts of ibuki and Leo here the darkest tones are orange, while on the darkened parts the darkest tones are a different hue (blue for ibuki purple for Leo)

I'm having a hard time finding the specular stuff that I liked about May's anchor...hm =/ it's probably just what they illustrate with  I-no's image, in wich they use the ILM texture and R is specular intensity, B is specular size. but the way it looks  here

 really sells me on animeish hilights.

BTW I know what R,G,B and alpha channels are, I have a somewhat vague idea of what vertex shading is, but I have no idea what a vertex texture is, or a control texture or SSS texture is a ILM texture for that matter.

definitively agree about the bones in the face. I think they either had even more swappable heads, or they just deformed the mesh to benefit each predefined shot for the cutscenes, and for regular ingame view just assumed regular sidescroller point of view. kind of like Meindbender does with their stuff.


There's a rigging demostration of it on vimeo =)

and people have replicated it on blender =)



« Last Edit: February 20, 2015, 04:58:51 am by Conceit »

Offline PixelPiledriver

  • 0011
  • **
  • Posts: 997
  • Karma: +6/-0
  • Yo!
    • View Profile
    • My Blog

Re: [Tool] 3D to 2D Blender Pixel Shader

Reply #11 on: February 19, 2015, 05:28:15 pm
Just wanted to jump in and blather a bit.

Quote
I have a somewhat vague idea of what vertex shading is
Vertex Shaders are passed data from vertices.
Then each vertex is processed, one at a time.
Some of the data is then passed to the Pixel Shader.
Each pixel is then processed using the data passed from the vertex shader, and then a single color is returned as the result in (r,g,b,a) format.

The entire process could just be called a Shader.
But you could also call it Vertex Shading.
Fact is you cant draw a single pixel without a vertices in the shader pipeline. --> in general :blind:
It's just built that way.

Quote
but I have no idea what a vertex texture is, or a control texture or SSS texture is a ILM texture for that matter.
SSS texture = Sub Surface Scatter texture
ILM = probly Illumination Texture for glowy stuff

Not too sure about control texture or vertex texture.
I'd have to see the context.
But in general you can pass in textures as any sort of data.
The colors they represent are used to process a calculation of sorts, so they could be really anything at all.
You could have a fade texture, a blur texture, a y axis texture, an x axis texture, a daylight texture, etc.
I once wrote a shader that passed in positions of items in the level as a texture.
And knowing that it is, we seek what it is... ~ Aristotle, Posterior Analytics, Chapter 1

Offline wzl

  • 0010
  • *
  • Posts: 298
  • Karma: +1/-0
    • View Profile

Re: [Tool] 3D to 2D Blender Pixel Shader

Reply #12 on: February 19, 2015, 06:08:11 pm
Fact is you cant draw a single pixel without a vertices in the shader pipeline. --> in general :blind:
It's just built that way.

you can use Points or Line/LineStrips though. Efficiency is a different matter though :P
And those too are routed through the shader pipeline.

Offline Ai

  • 0100
  • ***
  • Posts: 1057
  • Karma: +2/-0
  • finti
    • http://pixeljoint.com/pixels/profile.asp?id=1996
    • finticemo
    • View Profile

Re: [Tool] 3D to 2D Blender Pixel Shader

Reply #13 on: February 19, 2015, 11:35:35 pm
Conceit, you should definitely check out Blender's Freestyle functionality since you are interested in what they are doing here. eg. Google images shows a good variety of different effects achieved by freestyle. You can see cel shading is fairly popular. Every so often somebody posts an anime-style cel-shaded character using Freestyle on the Blender Google+ page.

What PPD has said is accurate, but if you really want to get a sense of how it works I suggest you do at least a little experimenting with weight-painting to see how the values blend and how you are limited by the color being per-vertex.

If you don't understand the vertex normal discussion very well,, you definitely could benefit from more 3d experience. I guess that the adjustment they perform might be considered as a type of selective 'sharpen' filter in terms of 2d imaging .. making the normals of adjacent faces differ more so that light will tend to light up one or the other but not both. IIRC there are existing 'filters' to apply this kind of adjustment to a mesh in blender, but usually they adjust the actual mesh, not only the normals.
If you insist on being pessimistic about your own abilities, consider also being pessimistic about the accuracy of that pessimistic judgement.

Offline PixelPiledriver

  • 0011
  • **
  • Posts: 997
  • Karma: +6/-0
  • Yo!
    • View Profile
    • My Blog

Re: [Tool] 3D to 2D Blender Pixel Shader

Reply #14 on: February 20, 2015, 07:07:17 pm
Quote
you can use Points or Line/LineStrips though. Efficiency is a different matter though :P
And those too are routed through the shader pipeline.
You called my "in general" bluff.  :blind:
I wanted to imply there are more layers to the topic without actually talking about them.
However, just to return volley:
How are points and lines defined?
Verts.
 :o



Also here's some great examples for understanding the potential benefits of modifying normals.
http://wiki.polycount.com/wiki/VertexNormal
« Last Edit: February 21, 2015, 07:02:11 am by PixelPiledriver »
And knowing that it is, we seek what it is... ~ Aristotle, Posterior Analytics, Chapter 1

Offline lachrymose

  • 0010
  • *
  • Posts: 345
  • Karma: +0/-0
    • View Profile

Re: [Tool] 3D to 2D Blender Pixel Shader

Reply #15 on: February 28, 2015, 03:38:59 pm
Tried to use the shader, won't render the pretty geometry. All I get are black frames.
Whats everyone running on? Trying to narrow things down. I'm running Win 8 64bit, AMD GPU.

Edit: After more reading around...AMD cards are indeed the problem.
« Last Edit: February 28, 2015, 10:52:39 pm by lachrymose »