PDA

View Full Version : any documentation on day-night cycles?



smerf1
03-08-2010, 07:29 PM
im looking for a tutorial on day-night cycles, but i cant seem to find one.

so im thinkin about testing it out my self not a 24 hour cycle, and so far i have thought of.

having maybe a directional light, and in certain points of the game, i have a trigger to determain the direction of the light, maybe even an area with a large trigger and a slow rotating animation on the directional light.

the only problem would be with sky domes. how would i change a daylight sky dome, to a night one?

gegebel
03-09-2010, 01:52 AM
I cheated and used a dark post-process :)

sueds
03-09-2010, 02:04 AM
I cheated and used a dark post-process :)

Really smart, any picture of what you did ?

cheers

Denny
03-09-2010, 04:15 AM
the only problem would be with sky domes. how would i change a daylight sky dome, to a night one?
With Material nodes. You can always make a custom one. :)

A Rabbit
03-09-2010, 04:51 AM
You could switch the skybox material by code, move the lense flare in kismet and change the postprocessing material with code.

EcHo_74
06-28-2010, 07:28 PM
I hope this might be of use, a very basic scene I created without kismet or unreal script. obviously you would want to make some fairly major changes, but it runs at a good frame rate on my computer.

http://dl.dropbox.com/u/6827713/Day%26Night.udk

Any questions, just ask, and once again, I know it would work better with kismet.

danimal'
06-29-2010, 04:25 PM
The easiest way to do this IMO is to simply attach a dominant directional moveable to a skydome that itself rotates (easily done in F4 properties, physics = rotating). Make the skydome material change color over time to reflect the time of day. To add more to it, include a separate cloud layer that flows across the sky. If you wanna get fancy, add a star map texture that blends into your material during the night cycle.

mesavage
06-30-2010, 06:12 AM
I tried dominant directional moveable, but for some reason there is still light when it should be dark.

If the directional light was produced based on the position of the movable in world location, rather than rotation of the dominant directional movable light, we might have a better effect.

I'm still playing with several scenarios of doing this and the suggestions made by danimal' certainly give me pause and is something i'll try tonight when I get home.

maximsubbota
07-02-2010, 04:10 PM
hey, im looking for a tutorial too, because there are problems with directional lights:
I have a big world, the shadow radius will be big and the shadows are going to be ugly
I dont want black shadows, but if I plug a sky light the night wont be dark.
and I need color changes.. day-yellow morning-light blue afternoon-orange

Angel_Mapper
07-03-2010, 03:40 AM
This is really specific for a tutorial request. :p

Havoc89
07-05-2010, 08:36 PM
http://www.moddb.com/groups/udk-developers-group/videos/daynight-cycle#imagebox

I dunno if this really requires a tutorial. I could write one, but to be honest it is just a combination of the simplest functions of various elements. Weather it is about lights, materials, fog, or post processing effects. It is done entirely via kismet and matinee.

taz1004
07-05-2010, 08:39 PM
That's very cool Havoc. A tutorial would be nice but if not, simple list of elements and post process you used would be great.

gegebel
07-06-2010, 02:32 AM
http://www.moddb.com/groups/udk-developers-group/videos/daynight-cycle#imagebox

I dunno if this really requires a tutorial. I could write one, but to be honest it is just a combination of the simplest functions of various elements. Weather it is about lights, materials, fog, or post processing effects. It is done entirely via kismet and matinee.

I'd still want a tutorial if you'd be so kind :)

Jarro
07-08-2010, 06:36 AM
I worried to make a good night/day cycles system too, but once I found simple decision:

First off all, the highest sky is in night without any clouds. I decided to make a FULL-sized sphere but with - (minus) size (I mean that this is like a simple sky with textures on the inside). One half of this sphere is using "Skydome" texture, and another is using "sky" texture. And I'm forcing this skydome to rotate :D .
The second sphere with minus size too will be smaller - It will be the sphere with the only clouds (other pieces is using only Alpha Channel). It's a full sized sphere too. I'm forcing to rotate this sky. And with only kismet we are making a skylight, that are changing the self parameters.
And a very important thing - the map is need to be saved to one file, the sky with the skydome to another file, and the clouds with the light and visual post-process volume in the third.
Then at the game we are combining these files at one, and when we need to make a very cloudy weather or overcast weather, we just replace the clouds in the game to dummy with a light or to a many clouds with post-process and a rain.
This system is giving us possibility to make day-night cycles and even dynamic weather ! One problem is to smoothy combine all the sky with clouds, lights and post process with another. But it will be very cool, I think :)

maximsubbota
07-08-2010, 11:02 AM
havoc thats very cool! Please do a tutorial, please.. T.T
I need it a lot

Slumberland
07-10-2010, 08:50 PM
I, too, would be deeply obliged for a tutorial, however short. I'm just starting to code and build levels, and the problem is the same everywhere, I know, with every little bit of me, that the solution is a simple combination of the core elements.

But I run afoul of the quirks of UDK's lights. The precarious state of both the MIC and the Vector Parameter are frustrating. Some things simply do not work, that did three builds ago. Tutorials that hanlde lighting parameters in kismet and matinee are out-of-date in months. The details may be tiny, but they throw me down the stairs over and over.

And I think the ability to pose questions correctly, query your toolset, and construct an elegant, simple solution is uncommon. The simpler it was for you to construct your video example, the more valuable it is to others that you share the thought process! The day/night cycle is a problem I am repeatedly phrasing incorrectly. I would love to see how you have constructed this pretty answer!

Ryan

Slumberland
07-10-2010, 09:42 PM
However, the rest of us need to pull our weight, learning, right? So let's lay the question out and try to figure out solutions.

Alright, so Havok says on the video description, that he is using properties of
-materials
-fog
-post-process volumes
-light

and that they can be combined completely in
-kismet
-matinee

with no UnrealScript.


Alright. So let's start with fog. I'm sorry if I'm moving slowly, but I'm not the only one stuck, so maybe this will help. There are two parameters that make sense to me immediately:
1) Color 1 and Color 2
The fog density and color are different between dawn and dusk, and this difference depends on light angle, so we're golden. We select a dominant color for our morning and evening cast. Opening M_EV_FogEnvironment_Master_01 in the material editor, there is a note that the alpha channel of each color is luminosity. So, we can make the fog effect more luminous (and therefore have more influence on bloom in PostProcess Volume), independently of the the fog's perceptible color-based-on-light angle.
So, let's start with a moving light of ANY kind, just to test. Script it in a circle in Matinee, as a loop. Then we can pretend this is our sun and tweak Color1 and Color2 until the color feels right, and then tweak the fuzzy bloom feel of dawn and sunset separately.
Finally, we have parameters for fog density and a logarithmic height scale.
So, what's the best way to get the fog to "disappear" as the sun ascends?

Oh, and I'm thinking of the basic, spherical FogEnvironment_01 static mesh that comes with UDK, as our base fog volume.

I'm thinking, for starters, imagine a very generic sky. Have no sky movement at all, but work on the sun and the effect on the landscape. For example, does the sun really have to be part of the skybox? How much mileage can we get out of bloom in PostProcess?

I have to look at the parameters of the basic fog material more carefully, because the exact function of each other parameter is not clear to me. But, ideally, we want to change as few parameters over time, in Matinee. If it seems like we have to manipulate a vector parameter on-the-fly, is there another way to look at it, so that the fog dissipates on its own, because of hypersensitivity to angle of light? Is this possible?

Thoughts? (I will dig through the parameters of all related objects, and begin working. Gotta place some trees and grass and terrain into a test level first. I think a lush level is crucial. We're not going to replicate the effects of the light through the trees and the detail of the shadows in Havoc's video without good foliage, moving trees, etc. (Thank you, SpeedTree!)

Thoughts

Slumberland
07-11-2010, 12:51 AM
We must also start thinking more like IK and less like owners of arms (I think). If we're looking for answers im the skydome, I think we're missing the point. Look at the "procedural sky" that is in operation in the DM-Deck level. It's a 146-instruction behemoth with multiple UVs, and by default doesn't even map correctly to a generic skydome (at least it doesn't for me).

So, I've been thinking about the different colors of light throughout the day. This sounds like a stupid question, but, what changes color when the light changes color? If you said, "everything, stupid", then you're with me. So, why don't we start with the postprocess volume? Change the color and bloom of everything and add sun, not "change the color from the sun." As long as we tie the changes to the presence of the sun, and not by time of day, the effect is consistent. Who cares if we're changing it at the wrong end?

(If you change the color of the light at a specific time, you can't change the weather, add clouds, etc. If the sun isn't visible, everything's different)

Also
*there is no sun in VCTF-Necropolis. There are other effects in place, but the physical orb and its bloom is just a single LensFlareSource actor. This is a static effect, but it's important to note there is no damned sun. How much cheaper is that than what we keep imagining we need? Multilayer, multitexture, animated skydomes? Are we sure?
*We need to check out the new LightShaft feature.
*Before they fix the fog in Sanctuary, take a look at it compared to the new Exponential HeightFog in Necropolis. I feel Exponential HeightFog is superior in every way, as the matter relates to making a morning fog. Am I looking up the right tree?
*It's time to start waking up early. Right? I'm wondering about static actors like volumetric lighting meshes. I mean, if an effect feels natural in the trees that doesn't elsewhere, why not save time and just place a volumetric light and/or fog effect there, and not try to get the effect on every sunrise, everywhere? But that depends on the world. The real one.
*At least in principle, the more characteristics of weather we can model without touching the skydome or commiting to added meshes and materials, the more possible a procedural weather system is. There's no reason not to go hog wild. Consider Left4Dead 2. You never see the skydome when they have rainstorms because they they made the storms intense and cranked the draw distance way down. You see practically nothing. It's blurry and confused and an excellent game mechanic, and I'll-be-damned if they didn't have to worry a whit about a multitexture skydome. (note to self: remember to think of sunlight in the trees at dawn as weather or there's no model for the slightest change in sunlight. Which is what we want, right? To add clouds. A sky. Change stuff.)

Alright. That is the state of my thoughts. Off to explore. Hoping for feedback, because it's a lonely lonely world trying to think this stuff through alone.

xnasorcerer
07-11-2010, 11:55 AM
http://www.moddb.com/groups/udk-developers-group/videos/daynight-cycle#imagebox

I dunno if this really requires a tutorial. I could write one, but to be honest it is just a combination of the simplest functions of various elements. Weather it is about lights, materials, fog, or post processing effects. It is done entirely via kismet and matinee.

Havoc, everyone here would like a tutorial showing how to achieve what you did on that video.

Jarro
07-11-2010, 01:52 PM
I think that is just changing parameters of the directional lights and of the PostProcess Volume at Kismet.

Jarro
07-11-2010, 01:53 PM
Much more difficult will be to make a skydome in the night and the weather

maximsubbota
07-11-2010, 02:14 PM
Havoc, everyone here would like a tutorial showing how to achieve what you did on that video.

yay, everyone wants a tutorial please :)

taz1004
07-11-2010, 09:53 PM
I think that is just changing parameters of the directional lights and of the PostProcess Volume at Kismet.

How do you animate parameters of Post Process volume in kismet?

Slumberland
07-12-2010, 02:49 AM
Okay, ladies and gentlemen. I think Havok is right.

I spent a few hours today fiddling with two things: a dominant directional light moveable, and a lensflare, and it is now obvious to me why Havok said he doesn't think a tutorial is necessary. I don't even have a sky, but I have a day/night cycle.

I think we need to be trying it ourselves and asking questions when we get stuck, because it's just fiddling with parameters. The day/night cycle is already there. We can move the dominant light.

So, do this:
1) create a simple terrain.
2) place a dominant directional light moveable at the center. In its properties, enable LightShafts
3) Open Kismet. Create a matinee sequence. Attach event>Level>LevelLoadedAndVisible to "start"
4)select your dominant light. In Matinee, create new empty group with your light.
5)find all available parameters, and make a track for each one. you should have:
Brightness
BloomScale
OcclusionMaskDarkness (for the LightShafts)
LightColor
BloomTint

6) Add a movement track. Set an arbitrary day length. Make it fast. You can change the play speed with a multiplier later. Say, 2 minutes.
7) Lay out a keyframe every 30 seconds. Enable quat interpolation. Pick one axis on your light. Rotate it 90degrees per keyframe.

8)Start adding effects to your sun. Remember, you can place your effects at any distance, as long as they're in the plane of your sun movement and they complete a rotation in 2 mintues, they will synch perfectly with your light.
9) if you want to keep visualization easy, and risk mockery, you can do like I did and make the directional light orbit the world for reference. (You can attach stuff to it that way, too).

There was an old thread on day-night cycles where Henrik showed a proof-of-concept, and everyone was slapping themselves saying, "wait, it's that easy?"

Yeah. So, if we really want help with the settings, we owe it to our fellow forum members to do the basics. Planting a single light in the level and seeing what options are available in matinee is not the stuff intermediate tutorials are made of. I really think we're all thinking it has to be an elaborate system of interpolating skydomes and a sun texture passing behind and. . .and... and.....
does it?

Then when we have questions, we can get help!

Slumberland
07-12-2010, 02:58 AM
Like this:

How do I change the direction of a lens flare?
I am using this definition of direction:
When the camera/player is facing the LensFlareSource, and the effect is both visible and centered, I'm calling the vector from the LensFlareSource to the player/camera the "direction." I thought this used to be set by rotating the emitter arrow. What happened?

I am using the June build, and I can't get the direction of the flare to change. I rotate the emitter, and the emitter arrow moves right along, but the direction of the flare does not change.

I am trying to add a lensflare to the sun. I have been careful. I am not translating the lensflare. I offset the pivot to the center of the world, and I'm animating it in orbit around the pivot. Pure rotation. I have changed the physics mode to Interpolate, and I have verified that, throughout the matinee loop, the emitter arrow faces the center of the world. Nevertheless,the vector from the emitter's ORIGINAL position to the pivot is fixed as the direction of the lens flare, no matter what direction the emitter arrow faces later. So, at exactly noon, the lensflare is no longer visible from below. At sunset, it is facing 180 degrees away from the center of the world, while the emitter arrow faces me.

What am I doing wrong?

maximsubbota
07-12-2010, 03:55 AM
seriously, I dont think I can do this without tutorial, im a newbie and we need help with this.
Please havoc if you are reading this, do a tutorial please, if you can of course, Its better for all a especific tutorial. Because I cant do this alone

Blade[UG]
07-12-2010, 04:54 AM
Work on the self esteem there maxim.

Jetfire
07-12-2010, 05:22 AM
lolz. This is why we didnt bother publicly showing off our (better looking and more technically advanced ;p) investigations into this. Plus we decided that for map durations of less than an hour, it's mostly pointless anyway, not worth the hit.
Slumberland, i approve of your attitude and approach, good work. The rest of you, remember when the more experienced guys here were working out how to do this, we did so from basics, and hours of sheer trial and error. There wasnt a fraction of the tutorials and udn documentation available now. Most requests for 'zomg gief codez plx' boil down to sheer laziness from our point of view.

Slumberland
07-12-2010, 06:04 AM
*add me to the PostProcessVolume in Kismet/Matinee question*
And one more: Is there a way to reference the default player camera in Matinee? That is, without creating a cinematic sequence, or constructing a new camera-attached-to-player relationship.

I see that I can change PPV settings in UnrealScript. ULocalPlayer.bOverridePostProcessSettings allows new values and transition interpolation times to fill the player's FCurrentPostProcessVolumeInfo CurrentPPInfo struct.

However, Havok did this without UnrealScript. So, two PPVs perhaps? One for morning one for evening, that fade in and out? Or one for both, that fades out and back in; and the bloom/light color of the dominant light are different for evening?

Is it computationally unpleasant to have multiple PPVs in the same space and shuffle between them?

((
Considering 1) the artistic control and flexibility afforded by PPVs and 2) UnrealScript has a single, neatly encapsulated, player struct for all post processing,
wouldn't this be an ideal candidate for "properties fully manipulable in Matinee?"
))

Slumberland
07-12-2010, 06:23 AM
MaximSubbota: you're not alone. My experience is, in its entirety, the 3DBuzz videos freely available on this site. I have referenced nothing that is not taught there. I don't have a working solution either. But *I* don't want to do this alone, either. So help me. I've got lots of time. If Step 1 above means you have to watch the Terrain tutorial and copy what Zack does, that's great. That's, maybe 15 minutes. Personally, I spend hours playing with stuff for every tutorial.

I'm asking questions, my friend. I can lay out my procedure, step-by-step. I can bore the senior members to tears, documenting each step. It only takes one person willing to do this, to find a solution. Two would be awesome.

Jetfire> yeah. I get it. It's too easy. But the specific settings are... everything. A "tutorial" by Havok would just be giving away something that's valuable. There are clearly many ways to do this. Any combination of setings, practically. So, in the end, a tutorial is even a bit of a lie. The color pallette and light environment are principally a function of art aesthetic for a specific project, not a neutral, "correct" solution. Havok has a beautiful working version, and he should keep it as his own.

It's also easy to underestimate the lighting system. I started with the UT3 version of the engine, and it would not be clear to me how to proceed with this version. The lighting and flexibility in recent builds of UDK are numbing; beautiful.

Slumberland
07-12-2010, 06:44 AM
Here's how I'm thinking about skydomes:

I don't think that night sky is necessarily "much more difficult". Let's break this down into components. Frankly, for starters, I'm going to have a sky that's nothing more than a graident. Then I can have a single texture for day and night, and tweak the bejeesus out of it until it looks good, day and night.
Open the Content Browser and look at the assets related to light. See a lot of gradients? Almost exclusively gradients? Right?
And then we can use either a color property parameter, or material instance parameter, to change the color, on-the-fly, of the sky, with a NUMBINGLY simple texture. Maybe we'll need a couple of gradients, to get the trasitions on the horizon.
I bet we'll learn a lot about one type of weather: haze. We won't have any clouds or stars yet, but if we can make daylight look like the mediterranean and the night look like that iron-sky-blue when there is a light layer of clouds and you can't see stars, that's a hell of a start.
"I'll cheat on a weather system, but the result is I'll need a hazy environment, at least for now." If that is a dissatisfying approach, look at the demo levels in UDK. Maybe this is a way forward, eh?

Okay, sleep. For real. I hate you sleep.

Sir. Polaris
07-12-2010, 09:54 AM
Jetfire> yeah. I get it. It's too easy. But the specific settings are... everything. A "tutorial" by Havok would just be giving away something that's valuable... Havok has a beautiful working version, and he should keep it as his own.

Just remember we are all on the same boat. If this community is going to go forward as a vibrant successful community it's starts with us. We are paving the road for the future elite, the future gurus and future teachers. Hording information doesn't grow the community. It only leaves the community - both UDK and Gaming in a state of wasted energy. This allows other industries to move in, or other engines to outperform with their dedication to their people. Just think of where would math, medical or science be if no one shared over the last 1000 years :)

All of us here are shaping the future of the UDK. So lets do it right - lets have more of these threads and keep information open. However lets teach the new and the needy to be respectful and not demanding. It's one thing to need help - it's another to harass and never learn anything on your own.

* Random speel over :D*

taz1004
07-12-2010, 01:44 PM
Been playing with this for awhile and yea, Dominant Directional Movable does most of the work for you. Two things I'm having problem with.

1. How do you animate values of Post Process volume?
2. Performance hit.

With dynamic shadows on most of the geometry, performance hit is pretty dramatic.

Havoc89
07-13-2010, 04:53 AM
I would love to make a tutorial, but I just dont have much time recently. I'll try and make one because of the shear number of requests, but no gurantees

JetFire, I'm curious as to how you did your system but in all honesty it cant be done in a drastically different manner because all of them require a moving light source, a kind of dynamically changing sky via materials with one or multiple sky domes. I know this one isnt complex, and it isnt ment to be. I put this together very quickly in just under an hour so it wasnt ment to be perfect what so ever, but more of a proof of concept using basic elements.

This isnt really a tutorial but I'm just explaining briefly how it works.

For this particular system everything is very very simplified. It has 1 dominant directional light servering as the purpose of the sun, and one normal directional light serving the purpose of ambient lighting. The values of things such as light colour, brightness, and rotations are all being handled via matinee.

I have one height fog actor and it's colour and density properties are also being altered via matinee.

Now in terms of post process, I've made 3 different volumes with 3 different settings. One for day, one for Dawn/Dusk, and one for night (ofcourse you can make as many as you want but I made only 3 in the interest of time). They are either enabled or disabled via kismet to match the changing lighting. Each of the volumes have their interpolation durations of their dof, bloom, and scene effect values set to a long duration to match the lighting. However for the one in the video since the day/night cycle was only 40 seconds long, I had set the values to something like 10 seconds if I recall correctly.

For the sky I just took a sky dome with a simple material where I blended 3 different constants. One 3 point constant had the blue, one the orange and one very dark blue (close to black). I used 2 lerps to blend the 3 colours together with 2 scalar parameters pluged in to the lerp's alphas which I controlled via matinee.

So yeah there you have it. A very simple but working day/night cycle. This isnt really a technical break through, it is just a simple system anyone can make, enhance, and customize for their purposes. I only made a basic system in the interest of time, and to prove that it is possible to make a fully working dynamic day/night system. I am working on a more polished and complicated one, and if I ever make a tutorial, it will most likely be on that. This one really doesnt require one because I think I explained everything I needed to make my point.

Hope that helps. I find that this way nothing is really a constant, and each and every map can have a fine tweaked system in play to make the ambiance of each map special and memorable.

maximsubbota
07-13-2010, 10:34 AM
ok, thanks, but can you explain me why you system is more complicated?, I want to know it because it may help me in my progress

taz1004
07-13-2010, 01:09 PM
Thanks for that explanation Havoc. It seems the post process and ambient light are the only two things I didn't do... and it looks so different. Gonna try it out.

As for triggering the post process volume in kismet... I'm trying to make the day shift happen with a keyboard stroke. And reverse with another key. I'm not sure how I can sync this between matinee and kismet. I may have to figure out another way. Is there way to animate movement of post process volume?

Someone mentioned that this day/night cycle can be achieved almost as cheap as with static lighting if done correctly. I really like to know what "correctly" means because for now, the performance hit is huge.

Jetfire
07-14-2010, 04:59 AM
Someone mentioned that this day/night cycle can be achieved almost as cheap as with static lighting if done correctly. I really like to know what "correctly" means because for now, the performance hit is huge.

I'd love to hear this as well.

Re the other stuff Havoc, we ended up fiddling with code a bit to access variables on things not normally animateable in matinee, and instead of postprocess volumes I used a single cameraanim since it has more params to play with. In our coder's one (we were in competition with each other :p) he moved everything out of matinee/kismet and into code, cuz that's how he rolls. It wasn't as pretty as mine, but far more flexible.

maximsubbota
07-14-2010, 08:17 AM
I have a lot of problems with the system, please, can anyone upload a map with a correct day-night system please?. Its for learning pruposes only

taz1004
07-14-2010, 02:34 PM
I have a lot of problems with the system, please, can anyone upload a map with a correct day-night system please?. Its for learning pruposes only

Why not tell us what you're having problems with instead because the method has pretty much been explained. You should get it working with basic matinee/kismet knowledge.

maximsubbota
07-15-2010, 03:37 AM
The system works, but I have a lot of problems with lighting, in the interiors as a day or morning it isnt dark enought, it is because I use skylight?
And the other problem that is the backfaces of my grass are very dark, and I dont know what can I do because I cant use emissive material.

Sorry for my bad english

taz1004
07-15-2010, 02:36 PM
You would compensate the light/dark issue with Post Process. Your grass, I'm not sure because I don't know what kind of grass you're using.

Slumberland
07-16-2010, 05:20 PM
MaximSubotta:
Okay, it's going to depend on the exact system you've set up.

I have noticed that the most recent builds of UDK pulled lightmass way back to a more UT3-looking light rig. It clearly offers much more care to be taken with contrast. For example, load the Top-Down-Level from the 3DBuzz tutorial, and compare your screen with what it looks like in the vidoes, and it's barely the same lighting rig.

I believe this is a substantial improvement. When I was following the videos with an earlier build of UDK, I couldn't get the lighting to stay dark in the shadows. Light bled too much everywhere (which is probably more accurate but less desireable for digital application. Without the contrast ratio of real life, how do you control lights modeled to be "real"?).

But there are difficulties managing a lighting system. I have found that foliage is difficult. The more foliage you have that has a distinct backside, the harder it will be to light with a dynamic day-night system. It's not necessarily because of the directional light. But, yes, the edges of shadows even with a static directional light are far sharper than a build from just 3 months ago.

I think there are numerous solutions. First, start with a static light, enable an emormous radius, and turn it way way down. Cover your level. Pick a color that matches one part of the day/night cycle. Fix one problem at a time.

For example, start with terrain. Enable the light on a separate channel, just with the terrain. If this makes your grass look better, then don't worry about adding the grass. If it's truly the backsides of the blades, add foliage separately.

I think you should do these separately, because you don't want to waste memory and computation on precomupted shadows from your grass ONTO the terrain, when you just need to light them both a little better. Turn shadows off for your static lighting. Brighten up everything that needs brightening, and then you don't have multiple shadows competing with one another, and the effect goes off without a hitch.

THEN tackle the next step. For example, decide how you want to eliminate the pointlight effect, which is different from a directional light. Simple solutions are: 1) use several uniformly overlapping lights. This has the advantage that the downsides (say, all of your lights are in the same plane and so the effect isn't perfect) are simple to understand.
2) Use lights scattered in space to break up the source patterns, make it look uniformly SCATTERED.
3) go hog-wild and create a whole separate lighting righ for static lighting. Try something like a giant transparent pane that operates like a window. It has a static distortion channel, and applies this distortion differently depending on the direction of incoming light. That way it would truly randomize the direction of light rays, making them excellent fill. Or block all of your lights, turn them way up, crank the number of bounces up, and just light your textures with later bounces.

And then switch those lights out for a different set at night.

Things I would consider:
Don't forget to try turning your lightmap resolution up, and try a higher quality light build. You may find (especially since UDK can precompute cyclic shadows) that with a high enough lightmap on key surfaces, the problem does not exist, with the exact light setup you have.

Don't worry too much if it doesn't look right. Get a working system, bit by bit. If your lighting isn't exactly right, decide if this is part of building a day-night cycle, or something to handle later, when you know what all your variables are. This is a crucial decision. It may be that what you add later depends on this part of your work being correct. Or it may be that you won't know what lighting to use for the sun until a lot more elements are in place.

I tend to think the second answer is the most reasonable. There is no perfect answer to this question. The lighting you need for your sun is going to depend on a lot of different factors. For example, if you are creating a pure outdoor environment, you are expecting totally different things from your dominant directional light than if your game is always outside, but in a city with streetlights, headlights, lit billboards and windows. Walls and haze.

It is my gut instinct that the dominant directional light moveable, on the dynamic channel, necessitates adding "invisible" lights to color your level. If this is your primary light source, the richness of lighting will suffer enormously if you do not compensate.

The sun's path in the sky is never an arc from due E to due W (except at the equator on a single day around March). An average summer day at, say, mediterranean latitude will have beautiful, long shadows that curve back to the south more and more toward sunset, and at sunrise. The further north you go, the more pronounced the effect. Take a look at this model:

http://astro.unl.edu/naap/motion3/animations/sunmotions.html

What I found the most instructive is that the math reduces to a simple idea: the yellow circle (The sun's apparent path) is just a latitude. Add a giant static mesh sphere and make it invisible. Attach your dominant light to a latitude above or below the equator of the sphere, and adjust its local rotation so that it points to the center of your level. Now when you animate the sphere in Matinee, the light will rotate, always staying focused on center. If you want seasonal progressions, you'll have to go a step further, but this works pretty well.

The point is this: when you have real shadows whose angles change across the day, sweep the ground, you will find that the back- and under- sides of your meshes get lit far more regularly than when the sun is directly above. You have long and accurate shadows instead of problematic, tight shadows that give you a lighting headache. Also since the more realistic sun path will be highly directional, it will probably be easier to decide where to put additional lights: your sun on one side, lights on the other. Ths is easier because "the other side" of your sun is no longer UNDERNEATH your level.


Long post. Let me know if you want help trying any of this out. Or if you have a specific problem, you're going to have to go into a little detail of exactly what is not working. The exact choices you've made matter.

Slumberland
07-16-2010, 05:40 PM
I'd also like to point out that what satisfies you is the correct answer. The procedural sky in UDK is complete Day-Night cycle. It's magnificient. But it's not what I want. It's too instruction-heavy and offers parameters I don't need, while joining parameters I want separate. And, personally, I find the lighting solution of the GDC-FeaturesDemo level to be a cluttered disaster. The trees sway and there are clouds going across the sky in shadow textures, but not actually crossing the sun. The cloud movement gets confused with the overstenciled shadows of the swaying trees, and it feels totally alien to me. I hate it. There's easily 2-3x the foliage necessary to convey the same effect. Deleting over half the ferns and tiny little plants; removing foliage meshes
-that are misplaced and the tops pop out the top of stones,
-to lengthen the path into the shade
-to smooth the feeling of wind (i.e. where computed, swaying shadows are right on top of a bunch of meshes that are not swaying, with swaying tiny bits growing up through them)
-to thin the underbrush under the tree canopies
-to elminate the bizarre combination of ferns
-to thin the trees and make the shade visible (and thereby cutting several 15000+ poly meshes)
-and to, generally, choose a mood for the scene

is one of the best experiments I played with. I found that the shadows were less confused and distracting, the lighting feels more natural, (I deleted the fake moving cloud shadows altogether), and the memory and computation savings are clearly sufficient to warrant a sorely needed correction: give the foliage a better cycle of swaying: less directional, and a longer loop of several motions, with less wind. I haven't done this, because I'm not sold yet on figuring out how to change the motion of thousands of meshes for a level I didn't make, but it's the obvious next step to me.

I don't like almost any of the choices made in this level. But it, too, is magnificent. Someone far more talented than I put it together, and it blew me away when I first looked at it.

But it isn't hubris to believe in your own choices. It's a necessary component of good design.

I think.

Also, please remember that I'm making everything up. EVERYTHING. I don't know anyone who knows anything about game design. If I say something I have manufactured it from zero, so I desperately need correction. That also means that if I'm ever right, if I help you, that you should believe, stubbornly and stupidly, that taking everything apart and having no idea what you're doing and doing it anyway is valuable. I really think it's all anyone ever does when they make something great. After all, it didn't exist before. Where else did it come from? Space? Nah. A dissatisfied brain, makin' **** up.

(I believe.)

Slumberland
07-17-2010, 07:51 PM
Everyone DID see the Procedural Sky, right?
-Material: M_Procedural_Sky_Master
(right-click and create a MaterialInstance Time Varying)

-Mesh: SM_SkySphere_4UVChannels
(if you want a simpler setup, best to build it yourself. The material won't map correctly to a regular skydome)


- there are 16 parameters you can change over time.
- the material automatically responds to a dominant directional light, giving the illusion of a physical orb, lighting bloom and lens flare.
- it also has a built-in sun position with some form of light shaft. If you do not want to match the default sun arc with your light, you will have to keep the built-in versions from rendering.
- setting a time cycle to the parameter "Stars" (0 = full daylight, 1 = full night) will automatically cycle the default sun, and move between day and night.
- Check the boxes "override", "loop" and "auto-activate", and set a loop time (in seconds) for any parameter you wish to change over time.
- Add control points (inval is the time (in seconds); outval is the paramater value you want at that time)
-It is not a light source.
-The pramaeter labelled "None" is the rim color.

Denny
07-18-2010, 06:07 AM
I actually missed it. I'm learning about it now, the light/camera vector operation is a good trick I didn't know about. Before I've tried to do the sun with cubemaps and UV operations, what a fool I've been. :D

maximsubbota
07-18-2010, 06:12 PM
How can i change the parameters of the material instance with mattine?

taz1004
07-18-2010, 07:03 PM
How can i change the parameters of the material instance with mattine?

You need to go watch the 3DBuzz video tutorials. You should watch all of it but especially the one about kismet and matinee. Guys here have beens saying that this day/night can be easily achieved with basic kismet/matinee knowledge. If you don't have that, of course you'll be having difficulty.

A Rabbit
07-19-2010, 05:46 AM
I actually missed it. I'm learning about it now, the light/camera vector operation is a good trick I didn't know about. Before I've tried to do the sun with cubemaps and UV operations, what a fool I've been. :D

Omg, that is a trick and a half! I was doing to same thing as you lol. Will post some footage soon.

I've been looking around but haven't found the answer. Does anyone know how Epic has attached the skybox to the camera in Deck?

*My bad, it's not attached, just extremely big.

maximsubbota
07-19-2010, 07:29 AM
I have mattine knowledge but I dont know how to change scalar parameters of the material constant with mattine

Jetfire
07-19-2010, 12:38 PM
If i remember correctly, you put the google in the google panel, then with the google slider, you google the google until it's all googled.

taz1004
07-19-2010, 01:01 PM
I'd like to share the workarounds to the problems I've been having. I was basically having two issues.

1. Animating Post Process Volume in matinee.
2. Performance hit.

For post process volume, I worked around it by creating multiple PP volumes with different values stacked up high (I created 5), attach all those volumes to a simple interpActor and then animated the interpActor up and down in matinee. It's a bit rough but works and seems to be the best way so far. Can't understand why we can animate post process values on a CameraActor in matinee but not the default cam.

I also was able to resolve the performance issue with dynamic lights by simply checking off dynamic lighting channel on all of my mesh. Only keeping static. I thought this would disable the dynamic shadow but it didn't. I'm still not exactly sure why this is but it's now silky smooth with shadow transition working perfectly. Only issue was that night was still too bright. Which I compensated with the post process volume.

As I've said before, I got the environment to shift when a key is held down and pause when released. It is now starting to look pretty cool and because my scene is urban, I will need to animate quite a bit of material instances to light up the windows. After all that's done, I'll post a video of it.

Slumberland
07-19-2010, 07:06 PM
I have mattine knowledge but I dont know how to change scalar parameters of the material constant with mattine

The answer depends on your build.

The procedure for handling MIC in the 3DBuzz video series will not work for current betas (I have tried April, May, June).

Using the June build, the following works for me:
1) Create an InterpActor for the static mesh SM_SkySphere_4UVchannels.
2) Apply a time varying material instance to the mesh
3) create an object variable for the static mesh in Kismet, and add it to a new group in Matinee.
4) You can now add both Float and Vector Material tracks to this group. With the Float Material track selected, you will find "Target material" listed in the properties. Add a line, and add the Material Instance.

The Material Instance Time Varying appears to retain all of the loop settings while being manipulated in Matinee. This is awfully handy, as you can trigger cloud formations and changes in sunset/sunrise color in Matinee, while leaving the base loops tucked away in the Material Instance properties.


Deprecated Procedure:
The state of MIC in Matinee and Kismet is shaky. The correct (deprecated) procedure for handling MICs does not work. It is as follows:

Create a Material Instance Actor (using the actor classes browser). Assign the MIC to this actor. Create an object variable for the ACTOR in Kismet, and manipulate the parameters in Matinee.

If you follow this procedure, your viewport will respond to Matinee keyframes. However, once you exit matinee, the keyframes are ignored. The effect will not render in game. For the time being, check every single setting in "play in editor", or you don't really know if you're animating anything.


I have not had this problem yet with the above setup (a MatInst TimeVarying as a target for a material parameter track). However, I am ignoring the correct procedure, which is to use an actor as intermediary.

I find Matinee crashes UDK routinely when handling MICs. Save often.

Alternatively:
By default you can't create a Material Instance object variable in Kismet. However, you can create an object variable for anything else, and then manually change the ObjectValue to your material instance. Matinee appears to handle this object variable directly. I do not know how reliable this is.

Slumberland
07-19-2010, 07:08 PM
(oh, and if you're not using the procedural sky, ignore the 4UV mesh. sorry. You might consider sticking with the Time Varying instance regardless).

Slumberland
07-19-2010, 07:15 PM
I actually missed it. I'm learning about it now, the light/camera vector operation is a good trick I didn't know about.

Okay, so i'm not the only one! The vector operations kind of scared me. Light vector? in a material? What the- ? what am I even doing. And then you see it in use. Ooooooooh! Holy crap, a camera vector and a light vector. Hey, that's sneaky. Oh my god this is awesome!

II Patch
07-20-2010, 12:54 PM
Originally Posted by Slumberland
The answer depends on your build.

The procedure for handling MIC in the 3DBuzz video series will not work for current betas (I have tried April, May, June).

Using the June build, the following works for me:
1) Create an InterpActor for the static mesh SM_SkySphere_4UVchannels.
2) Apply a time varying material instance to the mesh
3) create an object variable for the static mesh in Kismet, and add it to a new group in Matinee.
4) You can now add both Float and Vector Material tracks to this group. With the Float Material track selected, you will find "Target material" listed in the properties. Add a line, and add the Material Instance.

The Material Instance Time Varying appears to retain all of the loop settings while being manipulated in Matinee. This is awfully handy, as you can trigger cloud formations and changes in sunset/sunrise color in Matinee, while leaving the base loops tucked away in the Material Instance properties.


Deprecated Procedure:
The state of MIC in Matinee and Kismet is shaky. The correct (deprecated) procedure for handling MICs does not work. It is as follows:

Create a Material Instance Actor (using the actor classes browser). Assign the MIC to this actor. Create an object variable for the ACTOR in Kismet, and manipulate the parameters in Matinee.

If you follow this procedure, your viewport will respond to Matinee keyframes. However, once you exit matinee, the keyframes are ignored. The effect will not render in game. For the time being, check every single setting in "play in editor", or you don't really know if you're animating anything.


I have not had this problem yet with the above setup (a MatInst TimeVarying as a target for a material parameter track). However, I am ignoring the correct procedure, which is to use an actor as intermediary.

I find Matinee crashes UDK routinely when handling MICs. Save often.

Alternatively:
By default you can't create a Material Instance object variable in Kismet. However, you can create an object variable for anything else, and then manually change the ObjectValue to your material instance. Matinee appears to handle this object variable directly. I do not know how reliable this is. Im not quite sure how to do this process, i have followed the previous tips and have got the lighting, post process and fog volume system working but i want to be able to control what time in matinee to change the material to lets say stars? Do I have to set the values in the material instance editor for the time varying material before I set it up in matinee?, and if so how do I do set it up in the material instance editor? I tried to understand the documentation about it but I just couldn't wrap my head around it. Help Please?

Denny
07-21-2010, 04:50 AM
Okay, so i'm not the only one! The vector operations kind of scared me. Light vector? in a material? What the- ? what am I even doing. And then you see it in use. Ooooooooh! Holy crap, a camera vector and a light vector. Hey, that's sneaky. Oh my god this is awesome!To be honest I was surprised to the see a custom light function, I thought it was just an ordinary emissive material. :p

Slumberland
07-21-2010, 11:24 AM
Im not quite sure how to do this process, i have followed the previous tips and have got the lighting, post process and fog volume system working but i want to be able to control what time in matinee to change the material to lets say stars? Do I have to set the values in the material instance editor for the time varying material before I set it up in matinee?, and if so how do I do set it up in the material instance editor? I tried to understand the documentation about it but I just couldn't wrap my head around it. Help Please?

Okay, wait, we have to clarify. Are you using the Procedural Sky in UDK or have you set something up yourself?

II Patch
07-22-2010, 05:19 AM
Im using the Procedural Sky and the 4 UV Skydome Mesh. I followed all your steps to setting up the lighting scheme in matinee and have got that running fully and smoothly, i just want to be able to toggle or control the length of parts of the Material Instance Time Varying in matinee, but i not quite sure how to do that.

taz1004
08-04-2010, 01:15 AM
Sorry to dig up a dying thread but just wanted to share the results of my attempt at this effect.

http://www.youtube.com/watch?v=EglwOqvt4Io

Havoc89
08-04-2010, 01:44 AM
Very nice.

maximsubbota
08-04-2010, 05:43 AM
Hi people, and thanks Havoc, with your help I made an awesome day night cycle for my team and our proyect, here is.
http://www.moddb.com/games/stalker-unreal-zone/videos/24h-cycle#imagebox

taz1004
08-04-2010, 01:50 PM
That looks very good maxim. Only thing I thought didn't look right is the lightshaft from the sun. When the sun is coming up it looks like the lightshaft is coming from within the sun like a flash light instead of emitting outward as it should.

maximsubbota
08-05-2010, 04:15 AM
I know, but I dont know how can I fix it..
any idea?

taz1004
08-05-2010, 02:00 PM
I don't know how yours is setup so I can't give any direct advice. But in my case, I simply had a dominant directional with light shaft and it works fine. If you done something differently to the sun light, perhaps add another directional that syncs with your sun and have that directional cast light shaft?

maximsubbota
08-05-2010, 05:05 PM
its a simple directional light rotating and changing brightness. When the brightness is lower than 0.1 there arent light shafts, that is the problem..

taz1004
08-05-2010, 08:17 PM
How did you create the sun disc? It works as it should by default. You've done something to it to have that flash light effect.

Chosker
08-06-2010, 04:23 AM
I believe the 'flaslight' effect/bug/thing happens because the sun isn't rotating centered around the player. to know if this is the case, find out exactly the spot that the sun uses as the center of its rotation, stand there and look at the sunrise; then look at the sunrise again at a location the furthest away from that center point.
if this is the case, it's likely happening because your sun is a very bright and defined spot in the sky. to fix it, either
- make sure the sun always rotates about the player by attaching the sun to the player. I couldn't, because I wasn't able to attach only the position and not the rotation in Kismet.
- make the sun disc less defined (ie. alot more blurred edges, so that the shaft comes from a bigger and more blurred area - you'll get your shafts bigger and with softer edges, chances are the shafts will not look so "directed" to the side as they will cover more area);
or
- make your sun disc less bright so you don't have so much brightness and you get less shafts from that specific point

if you're really using *nothing* but a rotating light (ie. no sun disc) this will probably be useless for you, but maybe it's useful for someone else :)

maximsubbota
08-06-2010, 04:52 AM
its a dot attached to a world porld position as a circlcular reflection in the sky, and the light shafts are useless in my system, I am going to use a lens flare only.

Chosker
08-06-2010, 06:41 AM
what about other people's systems? :)
anyway being a dot my solution should be useful, I have something not so different from yours and ran into the same weirdness

taz1004
08-06-2010, 12:23 PM
As I said, simple dominant directional movable and enable light shaft. Works.

Slumberland
08-17-2010, 08:40 PM
Im using the Procedural Sky and the 4 UV Skydome Mesh. I followed all your steps to setting up the lighting scheme in matinee and have got that running fully and smoothly, i just want to be able to toggle or control the length of parts of the Material Instance Time Varying in matinee, but i not quite sure how to do that.

Whao, sorry man. My imaginary friend called (well, she emerges about once a year) and so I disappeared to a week of audio design bliss, then things were cluttered when I came back, keyboard broke, all kinds of dumb stuff.

Anyway. You MUST double click on your MatInstTimeVarying in the content browser and click
-Override
-Auto activate
-Loop
-set a loop time
for any parameter you want to change, otherwise it will not respond.

Easiest to click "Auto-activate all" at the top, and "override" and "loop" for one parameter at a time, and fiddle with each separately.

Start with "stars". Give them a cycle time, and you're golden.

Remember to add enough control points to see the change. Change to a value, hold it, change back, hold. And if your cycle time is, say, 120, make a control point at 120 with an identical outval to time 0.

To change the white haze at night, the parameter is ZenithColorNIGHT.



Please do not hesitate to email me directly if I am ever lax in responding. I am committed to learning UDK, but my area of interst is sound, so there's a lot of linear algebra and piano practice and shiny toys to get distracted by. The day-night cycle is practice for thinking in code, it is not a priority for me. But I will absolutely help you build one if it is a priority for you. Get my attention.

II Patch
08-19-2010, 10:06 AM
Whao, sorry man. My imaginary friend called (well, she emerges about once a year) and so I disappeared to a week of audio design bliss, then things were cluttered when I came back, keyboard broke, all kinds of dumb stuff.

Anyway. You MUST double click on your MatInstTimeVarying in the content browser and click
-Override
-Auto activate
-Loop
-set a loop time
for any parameter you want to change, otherwise it will not respond.

Easiest to click "Auto-activate all" at the top, and "override" and "loop" for one parameter at a time, and fiddle with each separately.

Start with "stars". Give them a cycle time, and you're golden.

Remember to add enough control points to see the change. Change to a value, hold it, change back, hold. And if your cycle time is, say, 120, make a control point at 120 with an identical outval to time 0.

To change the white haze at night, the parameter is ZenithColorNIGHT.



Please do not hesitate to email me directly if I am ever lax in responding. I am committed to learning UDK, but my area of interst is sound, so there's a lot of linear algebra and piano practice and shiny toys to get distracted by. The day-night cycle is practice for thinking in code, it is not a priority for me. But I will absolutely help you build one if it is a priority for you. Get my attention.

I know how to change the paramaters in the MITV but i doesnt seem like it changes over time, what i mainly would like to figure out is how to place it in matinee and have for example the stars turn on and off at certain times. Lets say i want to make a 24 hour cycle day last 3 minutes in matinee, i would want to turn stars on when the sun sets (60secs) and when the sun rises (120sec) i would slowly fade it out.

Snufkin
08-21-2010, 09:40 AM
So is there a tutorial for this or?

II Patch
08-21-2010, 10:02 AM
So is there a tutorial for this or?
There isnt one at the moment, i and with the work of Slumberland we are trying to make a decent day&night cycle and from that i will work on making a tutorial.

Snufkin
08-21-2010, 11:53 AM
There isnt one at the moment, i and with the work of Slumberland we are trying to make a decent day&night cycle and from that i will work on making a tutorial.

Thanks cus i was trying to scrape something with the info from this thread but i just got so confused lol.

taz1004
08-21-2010, 12:24 PM
Thanks cus i was trying to scrape something with the info from this thread but i just got so confused lol.

That's because there seems to be 2 different methods going on here. They're experimenting with procedural sky and in my opinion, is getting overly complicated. One quick look at the procedural sky material and you'll see why.

Havok however suggested simpler and at least in my view more effective method. And because it's simple and can be done with basic kismet/matinee knowledge, tutorial really isn't needed.

Slumberland
09-04-2010, 05:12 PM
That's because there seems to be 2 different methods going on here. They're experimenting with procedural sky and in my opinion, is getting overly complicated. One quick look at the procedural sky material and you'll see why.

Havok however suggested simpler and at least in my view more effective method. And because it's simple and can be done with basic kismet/matinee knowledge, tutorial really isn't needed.

Yes, we are using the ProcSky. However, the two methods are nearly identical. The ProcSky uses gradients for the sky, plus stars. A light function which makes sun and moon discs. This is what I was trying to build from scratch, using Havok's explanations. Adding post-process and fog will be the same procedure either way. Take the material apart. The rest is clouds. The day-night sky gradient with sun, moon, and stars can be saved separately.

Fiddling with parameters is too complicated? Buidling it is going to be harder!
You will want gradients to the horizon. Transparency. Light functions or at least lens flares to make sun and moon discs. Dusting of clouds or a light distortion pass to break up the static quality. Panning across the sky. Wait. Light functions. Panning. Uh-oh. Which direction? Relative to what?

If you're not absolutely clear about your dot products, uv maps, and the LensFlare editor, you might be in for some surprises! Good. Then make a tutorial when you get it all worked out!

I'm serious! By all means, make stuff yourself. But the ProcSky is way easier. Just the coordinate space and sky gradients would have tripped me up for some time. In fact, I still haven't untangled them, and I'm looking at a working example. With the ProcSky, we're teaching ourselves to do it from scratch. The only crappy part was trying to do it alone.

So. What exactly is not working for you? Be precise. Sometimes this is enough. Just articulating what is wrong can often answer the question. And if it doesn't, that's what we're here for. I'm open to personal emails. I've got time. But if we just don't feel like doing it, then that's what's wrong, and the question is already answered.

And, hey, I'm just in this for the sound. I know we're all in a hurry to get our projects working, but we have to engage the tools. Getting inside a game engine is not a detour, it is the matter before us. Right? Am I trying to convince you? Yes!

Chosker
09-06-2010, 04:31 AM
I did mine without gradients, all I used for the sky/horizon differentiation was a fogvolume at player level and attached to the player, and it creates a nice horizon/haze effect
the I did use some gradients for the sun flare + sun light pseudo scattering
check the WIP thread for screenies of mine