The International Simutrans Forum

 

Author Topic: Dithering Shadows in Blender/Gimp  (Read 3110 times)

0 Members and 1 Guest are viewing this topic.

Offline Gouv

  • *
  • Posts: 76
Dithering Shadows in Blender/Gimp
« on: January 28, 2010, 11:12:23 AM »
Hi,
it seems that i'll need to dither the Shadows outside the ground-plates in my current Blender project.
I guess that most people do it in some sort of Imaging programm. I was planning to do it in gimp also.
The questions are:

1. how exactly do you do it? Just painting single transparent pixels into rendered image or with some sort of alpha-mask or something like that? I'm really no expert, usually just cutting/pasting and doing other pretty basic stuff.

2. Is there a way to dither those Shadows directly in Blender? It seems to be doable with Composite Nodes(shadow pass?), but I couldn't get it to work yet.

Was planning to ask about Implementation of Alpha-Channel into Makeobj/Simutrans, but already found an old thread about it.

Offline VS

  • Senior Plumber (Devotee)
  • Devotee
  • *
  • Posts: 4855
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: Dithering Shadows in Blender/Gimp
« Reply #1 on: January 28, 2010, 02:57:01 PM »
Since there is no alpha in Simutrans, shadows are effectively "Emental" black - pattern of black and transparent pixels. With Gimp you could create a pattern, select the area you want and fill it...

Offline vilvoh

  • One of the good guys
  • Administrator (Inactive)
  • *
  • Posts: 4504
  • I'm the constructor, the architect
    • Escala real
Re: Dithering Shadows in Blender/Gimp
« Reply #2 on: January 28, 2010, 03:28:09 PM »
I haven't it test it but seems that using ColorRamp in Composite mode you should be able to extract the shadow.  I got the info from this tutorial. The resulting shadow seems to be plain with no alpha, so you just have to cut and paste.




Offline vilvoh

  • One of the good guys
  • Administrator (Inactive)
  • *
  • Posts: 4504
  • I'm the constructor, the architect
    • Escala real
Re: Dithering Shadows in Blender/Gimp
« Reply #3 on: February 02, 2010, 10:38:14 PM »
I've been trying to follow the advices of the tutorial mentioned above, and I must conclude it's possible to "render" the shadow in another image/layer and get a good result.

In fact, it's really simple. You need to use composite nodes with this config (all the details are in the tutorial)

Note: I used an extra node to output the result into a file. the Add node is a Math type node.

and from this scene..


you should get these shadows....


There's no possible overlaping between the original and shadow images, thus it's just a matter of copy and paste..   :)


Note: I've modified the shadow's color using GIMP to make it more visible.