PDA

View Full Version : Daylight System possible?



roxtar
11-11-2009, 05:43 AM
Hi everyone

I am wondering wether it is possible to have a lighting, depending on the ingame time. For example if i wanted to create a RPG it is neccessary to have a 24h cycle. Is it possible to compute lets say 48 lightmass-solutions and exchange them while the game is running?

sueds
11-11-2009, 07:37 AM
you can just use dynamic shadows. I know unreal engine don't with them quite well but with som tweaking and ambiant occulsion map I'm sure you'll have some nice effecs

Hourences
11-11-2009, 08:11 AM
It is impossible to calculate 48 full sets of lightmaps and also switch them around all the time.

Day and night is possible though, but not by switching lightmaps around.

Just messing with color correction, fog color, and fading over the sky texture from day to night is the easiest approach and also by far the lightest on perfomance. Dynamic light will be pretty heavy, but you could try it.

musilowski
11-11-2009, 09:15 AM
I tried this with a rotating spotlight. A ***** to create, but looks quite good if you get it right. Shadowing will eat perfomance quite a bit, but you can decide which objects cast dynamic shadows.

Then with matinee you can control light colors, brightness, fog color and density, etc.

roxtar
11-11-2009, 09:25 AM
@Hourences

changing color ist not what i want.
Look at Gothic 3 or Risen. There is dynamic shadow in the whole world, depending on the ingame time. Every 1-2 ingame-hour the shadow moves till the sun is gone and the moon appears. thats what i want.

Nawrot
11-11-2009, 10:22 AM
It was possible in UT3 with its lighting, i doubt its doable for lightmass. You could have multiple togglelights in UT3, each created its own lightmap for all affected objects. But doing it for 48lights for full RPG game with mostly outdoor areas is a bit too much for this engine. You better with cryengine for that task.

roxtar
11-11-2009, 11:10 AM
Well but i think, there isn't any "CDK" right?^^

I am still not getting it. Everyone is talking about everything and every game type is possible to create with UDK. So why can't i just create the lightmaps and use them whenever i want to. I know that this changing of the lightmaps (if it would be possible) would produce a huge lag, but then you would have to reload only the ones that are currently inside your view or in a specific range.

Nawrot
11-11-2009, 02:36 PM
would have to reload only the ones that are currently inside your view or in a specific range.

And that is weak point of your idea, all you have in UDK is streaming for textures. You do not have direct control over loading textures from harddrive. All is optimized, then cooked by editor. But maybe streaming allows you load those textures.

Then you need to find out if it can be done only for old lighting model or also for lightmass. If it can be done you need to manually backup all lightmap versions into package. And use streaming to load them in runtime. Next potential problem here: does udk allow you to request texture in advance or it does it only when you display it on screen.

That all means lots of problems for coders also for level designers.

roxtar
11-11-2009, 03:56 PM
A few minutes ago i've deleted the dominant direct light and only an ambient occlusion like lighting remained.
So another idea would be to mix this generated shadow with a dynamic sunlight which does not affect the lightmaps.

Brexer
11-13-2009, 03:16 AM
But, in this video of UT3 Tech

at 1:02 he says "And all the lighting and shadows in here is completely realtime and per pixel"...

http://video.google.com/videoplay?docid=4813891653639507070&q=Unreal+Engine+3#docid=7812474363719841621

I do not understand (though havent gone this far yet) as why a day/night system would be a problem.

Saishy
11-13-2009, 07:47 AM
Can you add all the lights for each time of day, and deactivate/activate them when you want?
I don't know how much expensive it is, but It will be just one loading, since the shadows on statics objects will already be calculated.

Denny
11-13-2009, 08:33 AM
Piece of cake, here's an example map file demonstrating static shadows with a non-directional day/night cycle. :)

It contains a dominant light which I built static lighting on. Then I animated its properties in Matinée. This little example took me 1 minute to set up.

schizoslayer
11-13-2009, 09:53 AM
Full scene Dynamic Shadows are not feasible with Unreal 3 out of the box. You would have to implement PSSM shadowing or some other similar solution. As UDK does not include the C++ source code or headers this will unfortunately be impossible.

roxtar
11-13-2009, 10:35 AM
Piece of cake, here's an example map file demonstrating static shadows with a non-directional day/night cycle. :)

It contains a dominant light which I built static lighting on. Then I animated its properties in Matinée. This little example took me 1 minute to set up.

Well but you have to agree that this only a compromise-solution. When you want a game, where time is important and you want the player to be able to find out the time by watching the sun and how the shadows draws on the ground it won't help. more and more i think the udk doesn't fit to my planned project.

Denny
11-13-2009, 11:02 AM
People were discussing a dynamic system with static built lighting and I gave them an example for it.

schizoslayer
11-13-2009, 11:17 AM
Full scene Dynamic Shadows are not feasible with Unreal 3 out of the box. You would have to implement PSSM shadowing or some other similar solution. As UDK does not include the C++ source code or headers this will unfortunately be impossible.

I have a tendency to prove myself wrong it seems:

After some research I found that if I changed UsePrecomputedShadows to false on all actors this changed them over to using ShadowBuffers rather than ShadowVolumes.

I opened up ExampleMap and removed the dominant light and turned off global illumination (so no Lightmass radiosity niceness). Throw in my Sunlight actor that interpolates between keyframes (saves doing it in matinee) and after some fiddling with the settings I had it casting dynamic shadows over the entire scene at a good framerate.

When I get home tonight I may take a moment to write up a tutorial on how to achieve this but contrary to my previous statement: This is possible. It just doesn't look as good as Lightmass lighting.

EDIT: Tried it out in DM-Deck and the framerate isn't good ~ 9fps so clearly this is only viable for levels with a relatively low number of actors in it.

Piranhi
11-13-2009, 11:38 AM
Would you be so kind as to do a quick tutorial of what you did still? Would be good to know and perhaps we can have a play around and see if it can be improved further.

Brexer
11-13-2009, 11:51 AM
Would be sweet if they switched from forward renderer (1 light shadow pr object) to deferred renderer ("unlimited" light shadows per object), hope i got that said correctly :).

Anyways, if we talk UDK, the renderer is the only thing i can put my finger on, when it comes to "next-gen" tech, and outdoor enviroments.

Perhaps the guys at Epic already have stuff in the works, but i dont know if unreal engine is only receiving fixes now, or also upgrades to the engine (or are they reserved for UE4 i wonder hehe).

So, only real limitation of this cool thing so far, in my eye's, is correctly lit and dynamic outdoor enviroments (shadows and lighting w/ day, night cycle and sun/moon effect), outdoor effects (no rain, snow like in GOW ?).

roxtar
11-13-2009, 12:23 PM
People were discussing a dynamic system with static built lighting and I gave them an example for it.

People? I have started this thread and asked from the first minute on, how to get a daylight system WITH dynamic shadows. I also said on the first page that changing color (light intensity) is not what i want.

Brexer
11-13-2009, 12:38 PM
Lineage 2 has this, its based on unreal engine 2 (or 2.5'ish)

dynamic shadows, daylight turning to night (including day clouds to night sky transition), but, they had the source.

eugen32
11-13-2009, 01:24 PM
I have a tendency to prove myself wrong it seems:

After some research I found that if I changed UsePrecomputedShadows to false on all actors this changed them over to using ShadowBuffers rather than ShadowVolumes.

I opened up ExampleMap and removed the dominant light and turned off global illumination (so no Lightmass radiosity niceness). Throw in my Sunlight actor that interpolates between keyframes (saves doing it in matinee) and after some fiddling with the settings I had it casting dynamic shadows over the entire scene at a good framerate.

When I get home tonight I may take a moment to write up a tutorial on how to achieve this but contrary to my previous statement: This is possible. It just doesn't look as good as Lightmass lighting.

EDIT: Tried it out in DM-Deck and the framerate isn't good ~ 9fps so clearly this is only viable for levels with a relatively low number of actors in it.

DM-Deck is not suitable for realtime dynamic shadowing solution, youll never have that level of detail in an RPG game. Also DM-Deck is an FPS map designed on height levels, your RPG game will move on horizontal plane most of the time which will alow you to use a shadow max distance (objects farther than the max distance wont render a shadow) to optimize the shadowing technique you use. I think with careful planning you could use the solution you found in an RPG game (just make sure you dont just throw there a bunch of actors and expect to work, is quite a surprise for me you still have 9 fps in that scene with dynamic shadows)

Denny
11-13-2009, 01:27 PM
People? I have started this thread and asked from the first minute on, how to get a daylight system WITH dynamic shadows. I also said on the first page that changing color (light intensity) is not what i want.
Talk about being egocentric. There are other people wanting a similar solution in this thread but not with the same demands.

schizoslayer
11-13-2009, 01:51 PM
...is quite a surprise for me you still have 9 fps in that scene with dynamic shadows)

Uber Work machine for the win :)

I doubt my home PC would manage it to be fair.

roxtar
11-13-2009, 04:25 PM
Talk about being egocentric. There are other people wanting a similar solution in this thread but not with the same demands.

You obviously haven't read the thread and now you say i'm egocentric? lol

But anyway. Dynamic realtime sunshadows would've been cool. Now i know, that the UDK is not suitable for any kind of game. Maybe in the next one. We'll see.

sueds
11-13-2009, 10:36 PM
But, in this video of UT3 Tech

at 1:02 he says "And all the lighting and shadows in here is completely realtime and per pixel"...

http://video.google.com/videoplay?docid=4813891653639507070&q=Unreal+Engine+3#docid=7812474363719841621

I do not understand (though havent gone this far yet) as why a day/night system would be a problem.

I haven't gone too far yet but it's quite hard to use stencil shadow volume for large environement. What we see in the video is not what I Can get into the engine and I don't know why. I try to get realtime dynamic shadowing but it run fairly slow and slo with this kind of lightning.

Denny
11-14-2009, 08:17 AM
But anyway. Dynamic realtime sunshadows would've been cool. Now i know, that the UDK is not suitable for any kind of game. Maybe in the next one. We'll see.
Actually it's possible, we're using dynamic realtime shadows on the whole world and running with decent framerates and we haven't even started to optimize yet. But because you're so nice I'm not going to help you. Have a nice day. :)

Kaldrick
11-14-2009, 08:30 AM
Actually it's possible, we're using dynamic realtime shadows on the whole world and running with decent framerates and we haven't even started to optimize yet. But because you're so nice I'm not going to help you. Have a nice day. :)

I'd be more then happy if you could help me instead ;P

Brexer
11-14-2009, 09:03 AM
Actually it's possible, we're using dynamic realtime shadows on the whole world and running with decent framerates and we haven't even started to optimize yet. But because you're so nice I'm not going to help you. Have a nice day. :)

Yeah thats nice, community spirit 1.0.1, we are like 50 other people in here asking the same question (and knowing it will come up again aswell), thanks i guess :confused:.

Denny
11-14-2009, 11:13 AM
Yeah thats nice, community spirit 1.0.1, we are like 50 other people in here asking the same question (and knowing it will come up again aswell), thanks i guess :confused:.
I'm tired of giving a load of answers to these forums every day, making videos and being generally nice and very rarely even get a thank you for the effort. So now when I entered a thread and gave a partial solution I get a *****y remark about how it wasn't the perfect answer. So no, I won't help anyone on this topic and you can thank Roxtar for that.

johanz
11-14-2009, 11:18 AM
I'm tired of giving a load of answers to these forums every day, making videos and being generally nice and very rarely even get a thank you for the effort. So now when I entered a thread and gave a partial solution I get a *****y remark about how it wasn't the perfect answer. So no, I won't help anyone on this topic and you can thank Roxtar for that.
I'm sorry, but your strategy is so wrong.
Why kill everyone for one person's deeds?
Oh and, thanks for help in my thread :D

roxtar
11-14-2009, 12:32 PM
How old are you Denny? That's something for the Kindergarden.
Over in the other Thread where I pointed out that UDK's solution of importing meshes isn't very good. "No UDK importing is super uber importing, no engine out there can compete with it" That's what is called a "fanboy".
When i want my project to be good, i don't wanna mess arround with partial compromise solutions. And nowadays i think noone is satisfied with a day and night cycle where only the intensity of the light changes.

@ at all the other people waiting for a solution

i'm sure that denny isn't the only guy who can tell us, how to do it.
Sorry anyway even if i don't know what i've done

Denny
11-14-2009, 01:25 PM
You talk about kindergarten behavior and directly after you do it yourself by doing the classic of telling others I said something I didn't to make me look bad. I guess we're on the same level now. Just because you put it in quotation marks doesn't make it a quote, people can read the thread by themselves.

I'm not going to reply anymore in this thread because of two reasons, our tantrum and secondly I can't give you the solution because I'm not allowed to - NDA. Honestly though, if anyone tried to think for themselves the solution is simple, it's straight in your face. You need to start think as a game developer, a problem solver, and not get the solution spoon fed every time you're stuck.

Xero
11-14-2009, 01:38 PM
Hey come on guys. Denny has been on these forums most ever day writing tutorials, answering questions and just generally tiring to help people out. I can certainly say that he has helped me more times than I can count.
Denny simply provided a possible solution to a question some of the other posters had. Granted it was not exactly what you want roxtar, you didn't have to act all "I made this this thread so you have to answer my question" about it. The guy was just trying to share what he knew.
Honestly I don't blame him for not wanting to help you out on this issue any further.

roxtar
11-14-2009, 02:08 PM
Didn't want to quote you. That was only the exaggertaed meaning what I personally took out of your answer.

I was completely new to unreal and my boss wanted me to check, wheter we can use the UDK. So i registred here and what i'Ve heard was "impossible" "no way"...
What would you think then? Because in the description of the kit it says almost "everything is possible".

Well i think my behavior wasn't that correct so sorry.

sueds
11-14-2009, 03:01 PM
ROXTAR doing and daylight cycle is posssible I just look into it and It's fairly simple in fact. You don't have to reinvent the wheel. Like you I believed there was no way to get it. But in fact you just don't have to do anything it's fully implemented in the game. So now if you have some framerate issue ( I haven't try it that much ) it can't be helped and you'll need to bake the texture.

edit : I did not mean there is a day/night feature like in Cryengine but the feature that you need are fully implemented. Matinee or Unreal script should be enough

eugen32
11-14-2009, 10:36 PM
Now i dont want to pick on anyone here but is obvious the poster doesnt give a damn if the feature is possible or not, he wants to do crysis like graphics in minutes without even sweat a little. He also doesnt care about what the hell this engine can do because he is not even interested, his conclusion on the types of engine can make is pretty self explanatory (as in no game type can be made with unreal). I suppose someone should have implemented this solution for him to make him happy. Come on, man, what a hell are you doing here if you dont care about enough to at least be nice to people who are trying to be nice with you?!
Anyway, in my opinion, Unreal could handle it, maybe not as easy and natural as crysis for example but as good im sure. You just have to give a **** about it.

strangelet
11-14-2009, 11:59 PM
i reckon you guys should do it like they used to do in the movies in the 50's and 60's. just do Daylight, then as night falls, introduce a lame dark blue postprocess filter and play cheesy cricket sound effects :)

fritzmonkey
11-15-2009, 04:31 AM
i reckon you guys should do it like they used to do in the movies in the 50's and 60's. just do Daylight, then as night falls, introduce a lame dark blue postprocess filter and play cheesy cricket sound effects :)

Don't forget the fireflys!

Denny
11-15-2009, 05:39 AM
To be honest Roxtar my behavior haven't been the best either so I'm going to apologize and accept yours.

Truce? :)

roxtar
11-15-2009, 05:58 AM
truce ;-)
I will try this with matinee. Since framerates doens't matter that much. (It is no game that we want to produce and at the end it is running only on high-end machines)

@eugen
that's far from what i've said in here.

Henrik
12-03-2009, 08:19 PM
Hopefully this answers some of your questions: http://utforums.epicgames.com/showthread.php?p=27014802#post27014802

No framerate hit that I noticed. Hard to say in regard to a more complex scene and lots of players, but it shouldn't be bad even then...