AuthorTopic: [WIP] Learning about shading  (Read 5369 times)

Offline Delibrete

  • 0001
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile

Re: [WIP] Learning about shading

Reply #10 on: June 10, 2013, 10:19:00 am
Haven't thought about the resolution just yet. I've been doing a bit of shading practice and I'm starting to get the hang of it. I will come back to anti-aliasing later on.

I was just looking at Vierbit's portfolio: http://www.wayofthepixel.net/index.php?topic=15295.0

And I quite like how he/she has done their smoothing on each of the lines (especially on the grayscale sokoban style game). I was just wondering how they managed to achieve this?

Thank you for the tips.

Offline PixelPiledriver

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

Re: [WIP] Learning about shading

Reply #11 on: June 10, 2013, 12:03:10 pm
I find it useful to think about rasterization when drawing to guide my blending choices.


The area of the pixel contained by the shape gives you the value used to select the color of the pixel.
The color can be a direct lerp between the two boundry colors of the area value, or the next step in brightness if you are using a limited palette.
Instead of area you can also use the distance of the midpoint of the pixel to the line if the shape is not contained, or if you want to consider pixels that fall outside the contained shape.
There are other things to consider but it's helpful for visualizing the concept.

Here's some more examples:
http://1.bp.blogspot.com/-JBDzu3pEQ_A/UbW7LvndFzI/AAAAAAAAGg0/fyGgFZiGSgw/s1600/aatriangle.png
http://4.bp.blogspot.com/-bNuO9YVa2VE/UbW7LsS4yZI/AAAAAAAAGgY/OnW3MINlWi0/s1600/Rasterization.png
http://2.bp.blogspot.com/-okYnLG5GpDY/UbW7MMf90bI/AAAAAAAAGgs/cEvd3iv58c4/s1600/trianglerast_f3.png
http://2.bp.blogspot.com/-EfQz6gLyD6E/UbW7MEjrl9I/AAAAAAAAGgk/cm5CED3NcbA/s1600/tri1.png
And knowing that it is, we seek what it is... ~ Aristotle, Posterior Analytics, Chapter 1

Offline Delibrete

  • 0001
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile

Re: [WIP] Learning about shading

Reply #12 on: June 11, 2013, 12:07:49 am
Thank you for the useful tips PixelPileDriver. I had never thought about rasterization when it came to blending. I might think about this technique when I get to those stages.