Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Product Chat / [Tutorial] Directional Lighting [Tutorial]

Author
Message
uzi idiot
Valued Member
14
Years of Service
User Offline
Joined: 27th Dec 2009
Location: Who Knows?
Posted: 10th Jul 2011 16:07 Edited at: 10th Jul 2011 18:05
This is a small tutorial on how to create directional lighting using shadows.

NOTE
You might need to edit you lighting quality for this

STYLE01 - Quick lightmapping (difficulty - medium)

You will need:
Lighting and shadows set to best for performance
A fully transparent texture.
A static object (for example: cylinderF)

How to do it:
First you need to place lights, then you can take the static object and set it's texture to the fully transparent one you made earlier
(to help position the barrel easily, set the transparency to 0, it will appear black in editor but transparent in game).


Now position the entity over the light marker (move the lightmarker up or down to change the width of the directional light)


Now run, it should resemble this


STYLE02 - Full Lightmapping (difficulty - hard)

What you will need:
Lighting and shadows set to Best for Quality
A static entity and a dynamic version of the same one (for example: Light2)
A texture for the static entity to cast the shadows
Another texture for the dynamic entity (alpha channel inverted from the static variant)

Part 1 - Creating the textures

This is the most time consuming part,
for it you will need:
the entity's _D2(diffuse) texture
and the entity's _I (illumination) texture, if one is available.

For the static entity, put the two textures on a layer each. Then add a layer mask to the _D2, copy (ctrl-c) and paste (ctrl-v) the _I into the layer mask and invert the colours.


Now delete the original _I layer and save the image as a .dds(you need a plug-in to do this), it will bring up a message saying 'DDS plug-in cannot handle layer masks, click export (this will apply the layer mask).

For the dynamic entity do the same, but no not invert the layer mask.


PART 2 - Entities

NOTE You need to remove the shader from the entity, if it uses one, by editing the fpe.

Put down two of the entity, one static, one dynamic(make sure it is immobile). Give each one it's texture, now put them on top of each other.
Now put a light marker inside them.


Now run it.



Mental Stability is over-rated!
Poloflece
13
Years of Service
User Offline
Joined: 14th May 2010
Location: Australia
Posted: 10th Jul 2011 16:27
Thanks, that's very clever


Poloflece

KeithC
Senior Moderator
18
Years of Service
User Offline
Joined: 27th Oct 2005
Location: Michigan
Posted: 10th Jul 2011 16:31
Very nice; added to the Compendium.

-Keith

DarkFrost
14
Years of Service
User Offline
Joined: 3rd May 2009
Location: ON, Canada
Posted: 10th Jul 2011 16:33
SICK!

Nicely done.

[img][/img]
Leongamerz
13
Years of Service
User Offline
Joined: 14th Aug 2010
Location:
Posted: 10th Jul 2011 18:02
Hey thanks for this tutorial Uzi.

Poloflece,Anayar,PWP,Henry Ham,Cosmic Prophet,Wolf,KeithC,Nickydude And Lee Bamber is my icon.
2Beastmode4u
13
Years of Service
User Offline
Joined: 14th Feb 2011
Location: Loading...
Posted: 10th Jul 2011 18:06 Edited at: 10th Jul 2011 18:17
Genius! Will definately help me.


Cheers.

God help me, Please.

Come on down to my site at Unleashed FPSCreators
uzi idiot
Valued Member
14
Years of Service
User Offline
Joined: 27th Dec 2009
Location: Who Knows?
Posted: 10th Jul 2011 18:20
Thanks everybody
@KeithC thanks.


Mental Stability is over-rated!
X Games
16
Years of Service
User Offline
Joined: 8th May 2007
Location: World Wide Web
Posted: 10th Jul 2011 18:41
nice m8

DarkJames
14
Years of Service
User Offline
Joined: 11th Aug 2009
Location:
Posted: 10th Jul 2011 19:54
Incredibly Clever!

Lets get into serious stuf
--------------------------------------
What about the blue text?.
Wraith Staff
17
Years of Service
User Offline
Joined: 3rd Apr 2007
Location: Hamilton, OH
Posted: 12th Jul 2011 05:13
That is sweet!

New sig in the process of being made
Ched80
13
Years of Service
User Offline
Joined: 18th Sep 2010
Location: Peterborough, UK
Posted: 12th Jul 2011 05:39
great tutorial! Cheers.

[url="http://raptr.com/No_Turn_Right?src=em_forum"][/url]
Norion
13
Years of Service
User Offline
Joined: 14th Jun 2010
Location: The Netherlands.
Posted: 12th Jul 2011 14:41
Awesome, thanks


N.

sorry for my english i'm an alien
defiler
15
Years of Service
User Offline
Joined: 4th Apr 2009
Location: Canada
Posted: 12th Jul 2011 23:22
Thank you very much for this tutorial!!

Current Project: Lost Contact: Chapter 1
uzi idiot
Valued Member
14
Years of Service
User Offline
Joined: 27th Dec 2009
Location: Who Knows?
Posted: 16th Jul 2011 11:15 Edited at: 16th Jul 2011 11:15
Another cool trick to do with full lightmapping is using the overlays from generic/overlays and retexturing them.
The overlay mesh is only one sided, so reposition them so the player can't see the textured side.
It will look as if there is a spotlight casting an image.


Mental Stability is over-rated!
Wolf
16
Years of Service
User Offline
Joined: 8th Nov 2007
Location: Luxemburg
Posted: 16th Jul 2011 11:19
Nice Uzi!

Hey, you might want to add that it looks a lot better if you use hollow cones on a wall... makes the light fall a bit better

Other than that, thanks for sharing!



-Wolf

I make serious coffee - so strong it wakes up the neighbors.
http://serygalacaffeine.deviantart.com/
Twitter:@Serygala
Bestorio
14
Years of Service
User Offline
Joined: 24th Oct 2009
Location:
Posted: 21st Jul 2011 19:16
Aargh! my invisible texture doesn't work! can someone help me?

human eye can only see 20fps, where a bird can see 90.
uzi idiot
Valued Member
14
Years of Service
User Offline
Joined: 27th Dec 2009
Location: Who Knows?
Posted: 21st Jul 2011 19:44
Try this (this is the one I use)


Mental Stability is over-rated!

Attachments

Login to view attachments
Bestorio
14
Years of Service
User Offline
Joined: 24th Oct 2009
Location:
Posted: 21st Jul 2011 22:19 Edited at: 22nd Jul 2011 09:38
thanks for these tutorials and the texture. i shall get you a beer:

EDIT: hmm, the light comes through the cylinder?

EDIT2: what i did with this:
also: what program did you use in the "STYLE02" for the texture editing?

human eye can only see 20fps, where a bird can see 90.

Attachments

Login to view attachments
uzi idiot
Valued Member
14
Years of Service
User Offline
Joined: 27th Dec 2009
Location: Who Knows?
Posted: 22nd Jul 2011 09:12
set lighting to 'best for performance' in the preferences.


Mental Stability is over-rated!
Bestorio
14
Years of Service
User Offline
Joined: 24th Oct 2009
Location:
Posted: 22nd Jul 2011 09:23 Edited at: 22nd Jul 2011 09:31
yes, i have done that (works fine now). how much does it effect on the overall quality?

human eye can only see 20fps, where a bird can see 90.
uzi idiot
Valued Member
14
Years of Service
User Offline
Joined: 27th Dec 2009
Location: Who Knows?
Posted: 22nd Jul 2011 16:30
Nothing, the only difference is that 'best for performance' ignores transparency.


Mental Stability is over-rated!
Bestorio
14
Years of Service
User Offline
Joined: 24th Oct 2009
Location:
Posted: 22nd Jul 2011 19:17
so windows don't work?

human eye can only see 20fps, where a bird can see 90.
uzi idiot
Valued Member
14
Years of Service
User Offline
Joined: 27th Dec 2009
Location: Who Knows?
Posted: 22nd Jul 2011 21:14
Windows are dynamic, they don't cast lightmaps (shadows)


Mental Stability is over-rated!
Bestorio
14
Years of Service
User Offline
Joined: 24th Oct 2009
Location:
Posted: 28th Jul 2011 09:17
i see

"Problem?" - Troll
Le Shorte
15
Years of Service
User Offline
Joined: 6th Apr 2009
Location: Wisconsin
Posted: 28th Jul 2011 09:18
Wow! It looks great! I'll definitely use this next time I'm developing a game.

Cheesehead for life.
Tomik18
FPSC Reloaded TGC Backer
14
Years of Service
User Offline
Joined: 8th May 2009
Location: Slovakia
Posted: 3rd Aug 2011 17:56 Edited at: 3rd Aug 2011 17:58
i dont understand this tutorial i dont understand how can i add mask to layer

My PC specs: AMD Phenom X4 B60 3,30Ghz
4 GB RAM
GTX 560 1GB DDR5
uzi idiot
Valued Member
14
Years of Service
User Offline
Joined: 27th Dec 2009
Location: Who Knows?
Posted: 3rd Aug 2011 19:22
@Tomik18: In Gimp rightclick the layer and click 'Add Layer Mask'.
I hope this helped.


Mental Stability is over-rated!
Tomik18
FPSC Reloaded TGC Backer
14
Years of Service
User Offline
Joined: 8th May 2009
Location: Slovakia
Posted: 3rd Aug 2011 19:48
@uzi: i dont understand this line
Quote: "For the static entity, put the two textures on a layer each. Then add a layer mask to the _D2, copy (ctrl-c) and paste (ctrl-v) the _I into the layer mask and invert the colours."


My PC specs: AMD Phenom X4 B60 3,30Ghz
4 GB RAM
GTX 560 1GB DDR5
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 3rd Aug 2011 21:37
Open the _D2 texture in Gimp. In the file menu open as layers the _I texture. In the layers dialog click on the main surface highlighting it. Right click and add layer mask. A dialog window will open, click add. Highlight the _I texture and hold Ctrl and press the c key. highlight the layer mask and hold Ctlr and press the v key. In the layer dialog window right click below the layer images and choose anchor layer. Now go to the color menu and invert. Right click the _I layer and delete.

WickedX
Tomik18
FPSC Reloaded TGC Backer
14
Years of Service
User Offline
Joined: 8th May 2009
Location: Slovakia
Posted: 3rd Aug 2011 22:17
what is "_I" ?

My PC specs: AMD Phenom X4 B60 3,30Ghz
4 GB RAM
GTX 560 1GB DDR5
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 3rd Aug 2011 22:47
"_I" is the illumination map texture. Look in the "FPS Creator\Files\texturebank\scifi\scenery\lights\light2" directory. light2_B_D2.dds and light2_I.dds are the textures used for this tutorial. In this case "_I" refers to light2_I.dds.

WickedX
Tomik18
FPSC Reloaded TGC Backer
14
Years of Service
User Offline
Joined: 8th May 2009
Location: Slovakia
Posted: 3rd Aug 2011 23:28 Edited at: 3rd Aug 2011 23:44
ok is done but i have some problem as Bestorio. i set best performance delete illuminations effect. but I want to ask this
Quote: "Put down two of the entity, one static, one dynamic(make sure it is immobile). Give each one it's texture, now put them on top of each other.
Now put a light marker inside them."

I work in FPSC X10

My PC specs: AMD Phenom X4 B60 3,30Ghz
4 GB RAM
GTX 560 1GB DDR5
angusm3
15
Years of Service
User Offline
Joined: 6th Mar 2009
Location: Right behind you...
Posted: 11th Aug 2011 20:25
Could you explain step 2 just a bit more elaborately? I read all the comments and it still doesn't help, I don't know what you meant by invert and I'm using paint.net.

I appear to have burst into flames...
uzi idiot
Valued Member
14
Years of Service
User Offline
Joined: 27th Dec 2009
Location: Who Knows?
Posted: 11th Aug 2011 21:01 Edited at: 11th Aug 2011 21:25
I'll see what you have to do in Paint.net.
[edit] I'm afraid Paint.net doesn't seem to have Layer Alpha masking. Your only choice is to use Gimp.


Mental Stability is over-rated!
Bootlicker
15
Years of Service
User Offline
Joined: 29th Mar 2009
Location: Germany
Posted: 11th Aug 2011 21:46
wow. very very clever.


Login to post a reply

Server time is: 2024-04-19 20:38:29
Your offset time is: 2024-04-19 20:38:29