Author Topic: Tutorial: Creating semi-transparent shadow sceneries with Gimp.  (Read 5721 times)

0 Members and 1 Guest are viewing this topic.

Offline VirtualTT

  • Veteran
  • *****
  • Posts: 1026
Tutorial: Creating semi-transparent shadow sceneries with Gimp.
« on: February 14, 2010, 05:30:30 am »
"Your pony died because it wasn't pretty enogh..."
х_Х
This tutorial describes how to convert semi-transparent polygon shadows into scenery with Gimp. It should take less then 5 min.

Technique to use semi-transparent polygons to create fading/shadow effects can give quite an impressive results. However it isn't very popular since using polygons with semi-transparency in not a FPS-friendly solution. So converting them into scenery can solve this problem.




Demo map attached.

1. So I've got some polygon shadows on my map and now going to convert them into sceneries. Ensure that shadow polygons are colored with 100% black and there is no gaps between them.


2. Go to PW preferences and set background colour to pure white. Click OK.


3. Select all shadow polygons. This can be done by selecting black colour as current and using "Select by colour" item in the Edit menu.


4. Drag them to some empty space and deselect. Make sure that zoom is set to 100% (press *) and only polygons and texture are visible. Make a screenshot.


5. Start Gimp, paste screenshot into new image (Main menu=>Edit=>Paste as=>New image). Select shadow area with Rectangular selection tool.


6. Make selection floating (Main menu=>Select=>Float). Create a new layer (Main menu=> Layer=>New layer) so your floating selection will become a new layer. Delete bottom layer with the rest of screenshot image.


7. Duplicate the shadow layer (Main menu=>Layer=>Duplicate layer). Invert it's colours (Main menu=>Colors=>Invert).


8. Add a "Transfer alpha-channel" ( ! not "Layers alpha channel" ! ) mask to the bottom ( ! not inverted ! ) layer (Main menu=>Layer=>Mask=>Add layer mask).


9. Here comes the tricky part: Cut the inverted layer and paste in over the mask ( ! not over the bottom layer itself ! ). In order to ensure this click on the mask on the Layers panel. Result should look like this:


10. The result of the previous action doesn't look any near the expected, but do not worry! Apply layer mask (Main menu=>Layer=>Mask=>Apply layer mask). Colorize the image (Main menu=>Colors=>Colorize) as shown on the screenshot. Woa! Now it looks much better. I suggest to colorize it into pure white since this will help to reduce the file size and actual colour can be later adjusted in the PW.


11. The scenery is almost ready, all left to do is to save it as png file. But first remove the colour information (Main menu=>Image=>Mode=>Grayscale). Save file as png with the shown setting.


Result: 576x301 px 16 bpp 11 kb png image :D

12. Lets try new scenery in the PW. It looks exactly as the polygons shadow!


You can also try applying some additional filters (such as blur or softglow) to shadow to make it look softer and more natural.
« Last Edit: February 14, 2010, 07:21:46 am by VirtualTT »

Offline Mr. America

  • Soldier
  • **
  • Posts: 221
  • Watch out for the blablabla!
    • My arcor homepage. There are just my maps.
Re: Tutorial: Creating semi-transparent shadow sceneries with Gimp.
« Reply #1 on: February 14, 2010, 06:03:51 am »
Oh nice, that's what I needed. Did you get my message? I'm not sure wether it sent it right, because there is no mail in my "sent items".

Offline VirtualTT

  • Veteran
  • *****
  • Posts: 1026
Re: Tutorial: Creating semi-transparent shadow sceneries with Gimp.
« Reply #2 on: February 14, 2010, 06:14:37 am »
Oh nice, that's what I needed. Did you get my message? I'm not sure wether it sent it right, because there is no mail in my "sent items".
Yeah, i've received it.

Tutorial is finished, hope it'll be helpful.  [pigtail]
« Last Edit: February 14, 2010, 07:37:41 am by VirtualTT »

Offline biohazard

  • Camper
  • ***
  • Posts: 337
  • B4bY NighT
    • B4bY NighT
Re: Tutorial: Creating semi-transparent shadow sceneries with Gimp.
« Reply #3 on: February 14, 2010, 11:41:36 am »
wow nice tits, i luv gimps too.

So, if you can do the same job using polies and scenaries, is better do it using scenaries, to save some fps?

Offline VirtualTT

  • Veteran
  • *****
  • Posts: 1026
Re: Tutorial: Creating semi-transparent shadow sceneries with Gimp.
« Reply #4 on: February 14, 2010, 03:09:40 pm »
Yes, especially in case of replacing semi-transparent polygons.

Offline Horve

  • Flagrunner
  • ****
  • Posts: 692
  • Vig
Re: Tutorial: Creating semi-transparent shadow sceneries with Gimp.
« Reply #5 on: February 14, 2010, 03:48:38 pm »
I wish polyworks had a built-in function that would enable you to set the bg to transparent and save the currently-on-the-screen image as a .png (or other format?) file (layer style).

The shadow creation could be useful, but there is really no point in wasting time on creating such shadows for a soldat map. Meaning that time isn't worth the effort, if you have a slow machine, which opens gimp rather slowly and loads brushes for several minutes, shadow making would end up being too time-consuming. I wonder how much time would shadowing a really large and complex soldat map would take and would it be worth it?
« Last Edit: February 14, 2010, 04:44:45 pm by Horve »

DarkCrusade

  • Guest
Re: Tutorial: Creating semi-transparent shadow sceneries with Gimp.
« Reply #6 on: February 14, 2010, 09:14:11 pm »
I wish polyworks had a built-in function that would enable you to set the bg to transparent and save the currently-on-the-screen image as a .png (or other format?) file (layer style).

I once suggested exactly that. I don´t know whether it´s being considered for Polyworks, though ...

Great tutorial. Since you used Gimp for this tutorial every mapper has access to this. Thumbs up!

Offline Mr. America

  • Soldier
  • **
  • Posts: 221
  • Watch out for the blablabla!
    • My arcor homepage. There are just my maps.
Re: Tutorial: Creating semi-transparent shadow sceneries with Gimp.
« Reply #7 on: February 25, 2010, 08:00:41 am »
Now for a final question: I've my map with and without sceneryshadows. The one without (therefor with polygon shadow) has about 1000 polys soley for the shadows and a fps of around 200. The other one has a png scenery with 75 kb (or is it kB?)  and a fps of around 230. Is that efficient? What is better?

DarkCrusade

  • Guest
Re: Tutorial: Creating semi-transparent shadow sceneries with Gimp.
« Reply #8 on: February 28, 2010, 10:04:38 am »
I though higher FPS were better than lower? Where´s your point.

Offline Horve

  • Flagrunner
  • ****
  • Posts: 692
  • Vig
Re: Tutorial: Creating semi-transparent shadow sceneries with Gimp.
« Reply #9 on: February 28, 2010, 12:12:50 pm »
greater fps = better
230 > 200
230 is better than 200 and less polygons is better.

Offline VirtualTT

  • Veteran
  • *****
  • Posts: 1026
Re: Tutorial: Creating semi-transparent shadow sceneries with Gimp.
« Reply #10 on: February 28, 2010, 12:19:21 pm »
Speaking of semi-transparent polygons: In order to improve FPS it's more important to remove them all rather than lower their number. I heard that some ppl experience considerable fps drop even if just a single semi-transparent polygon is added.

DarkCrusade

  • Guest
Re: Tutorial: Creating semi-transparent shadow sceneries with Gimp.
« Reply #11 on: February 28, 2010, 02:05:22 pm »
@VTT: I wouldn´t believe such stuff without seeing it myself.