Not logged inOpenClonk Forum
Up Topic Development / Developer's Corner / Screenshot log 2: Lights
1 2 3 4 5 Previous Next
Parent - By Maikel Date 2012-08-30 13:06
No summer school in Cargese ;)
Parent - - By Saiodin [de] Date 2012-08-19 20:44
I'm sure somewhere is the answer, but I'm some kind of noob regarding Repositorys. How can I 'update'? With Turtoise?
Reply
Parent - By Zapper [de] Date 2012-08-19 20:58
You could rightclick in your Clonk folder and open the "Workbench". Then you click on the small arrow with the title "Pull/Eingehende Änderungen laden" and then you should see the revision "FoW/lights preview" pretty much on top. You can right-click it and select "Update".

Then you have the newest content and source, but if you don't want to build the engine yourself, you can check out the autobuilds page: http://hg.openclonk.org/openclonk/autobuild/
A build of the engine from the light branch should appear there soon (I hope)
Parent - - By Clonkonaut [ie] Date 2012-08-19 20:59
It is more complicated than that unfortunately.
You'd have to install TortoiseHg, clone the repository, update it to the lights branch, set up something to compile an engine (Visual Studio or MinGW) and compile an engine.

Fortunately enough, Zapper triggered an autobuild. But you will need someone to post the link to the dependencies (meaning: a zip full of dll files) in order to run this build.
Reply
Parent - - By Clonkonaut [ie] Date 2012-08-19 21:04
Apparently, the deps are in the dev snapshots, so running the engine from the same folder is enough.
Reply
Parent - By Saiodin [de] Date 2012-08-20 14:54
Hmm... I guess I can wait ^^'
Reply
Parent - - By Newton [de] Date 2012-08-20 20:24 Edited 2012-08-20 20:28
It is absolutely astonishing to finally see it live! And it even runs on my ol' graphics card - I think it doesn't even make the game much slower than it did run for me before. It is a whole new gameplay I would say. Still I wonder if it would be ever possible to have several light sources which light your base and other things.

For my graphics card, I saw the following problems:
* (!) only each second or so, the display of the landscape is updated. So if I dig, I seem to move into the earth.
* The shown black triangles on the four sides
* on zooming in and out, the lighting lagged behind
* light flickering a bit (which is not too bad, could be also deemed a feature ;-)

Did I already mention how absolutely awesome this is?

Edit: For all those who can't compile and as the last autobuild for the lights branch failed - here is my version. (win32) Use it with the latest development snapshot.
Attachment: clonk.exe (5912k)
Parent - By PeterW [gb] Date 2012-08-20 21:00

> * (!) only each second or so, the display of the landscape is updated. So if I dig, I seem to move into the earth.


Yes, that also happens here. I have no idea whatsoever what's causing that. Maybe framebuffers are somehow incompatible with writing to textures directly?
Parent - - By Caesar [de] Date 2012-08-20 22:15

>Still I wonder if it would be ever possible to have several light sources which light your base and other things.


Try launching a scenario with multiple clonks (or one where you are likely to die and be relaunched). Doesn't get laggy for me.
Parent - By PeterW [gb] Date 2012-08-20 23:49
Yes, the number of lights doesn't matter too much. Especially small lights - the tutorials should probably have a good number of torches on the walls.
Parent - - By Newton [de] Date 2012-08-22 19:44 Edited 2012-08-22 19:52
Got it crashed! Here is the stack trace:

  clonk.exe!C4FoWLightSection::Render(C4FoWRegion * pRegion, const C4TargetFacet * pOnScreen)  Line 1159 + 0x3 bytes  C++
   clonk.exe!C4FoWLight::Render(C4FoWRegion * pRegion, const C4TargetFacet * pOnScreen)  Line 783 + 0x9 bytes  C++
   clonk.exe!C4FoW::Render(C4FoWRegion * pRegion, const C4TargetFacet * pOnScreen)  Line 775 + 0x9 bytes  C++
   clonk.exe!C4FoWRegion::Render(const C4TargetFacet * pOnScreen)  Line 761  C++
   clonk.exe!C4Viewport::Draw(C4TargetFacet & cgo0, bool fDrawOverlay)  Line 242  C++
   clonk.exe!C4Viewport::Execute()  Line 347  C++
   clonk.exe!C4ViewportList::Execute(bool DrawBackground)  Line 758  C++
   clonk.exe!C4GraphicsSystem::Execute()  Line 140  C++
   clonk.exe!C4ApplicationGameTimer::Execute(int iTimeout, pollfd * __formal)  Line 828  C++
   clonk.exe!StdScheduler::ScheduleProcs(int iTimeout)  Line 219 + 0xd bytes  C++
   clonk.exe!C4AbstractApp::Run()  Line 27 + 0x9 bytes  C++


I saved the dump, so if you want to know the values of any variables, do ask.
Parent - - By PeterW [gb] Date 2012-08-23 15:43 Edited 2012-08-23 16:05

>   clonk.exe!C4FoWLightSection::Render(C4FoWRegion * pRegion, const C4TargetFacet * pOnScreen)  Line 1159 + 0x3 bytes  C++


Hm, that's the mid-ray loop for the intermediate point calculation. I suppose a check for NULL wouldn't hurt there - even though it shouldn't really be triggered in the first place. That's why I waited so long to show this code - there's still lots of weirdness going on that I don't fully understand :/

I blame floating point numbers, personally.



Like this. That shouldn't happen - that's what this "intermediate point" thing is for in the first place.
Parent - - By Newton [de] Date 2012-08-27 14:25

>Hm, that's the mid-ray loop for the intermediate point calculation.


Hehe, reminds me of my bachelor thesis (p25-26). What if the ray is just one unit long?
Parent - By PeterW [gb] Date 2012-08-27 15:23 Edited 2012-08-27 15:29
What do you mean? That loop determines for a shoft shadow how "deep" it should be by accessing the un-smoothed ray at the position which corresponds to the middle point of the fade. Apparantly it hit the end of the ray list for some reason, which should really only happen if the mid point somehow was outside the ray list range (after all, I have 4 lists covering 90° each). On paper, this positively shouldn't happen, as all points are products of projections of existing points and suitable points close to the light point. Indeed it generally is pretty conservative with projecting points "inwards" when in doubt - which is one part of the explanation for the black triangles at 45°.

One point falling out of the section is actually semi-reproducable in tutorial 1 - sometimes when you walk into the tunnel, you see a bright triangle right-top in the earth. It doesn't cause a crash, but it's probably the same root cause. I'll just have to bite the bullet sometime and go through step-by-step logs of everything until I can pin down at what point exactly that point goes astray.
Parent - By PeterW [de] Date 2012-09-24 10:18
Okay, put a bit of time into investigating this over the vacation. Should now smooth both edges, and crash a lot less often.
Parent - - By Saiodin [de] Date 2012-08-23 14:07
Thanks for the build, but do I need to activate the shadow somehow? I can't see any of the new shadow effects. But I have the bug wit the "*  (!) only each second or so, the display of the landscape is updated. So if I dig, I seem to move into the earth." anyways.
Reply
Parent - - By Saiodin [de] Date 2012-08-23 14:17
Yeah, I saw that. Posted pretty at the same time ;o.
But, using your file changes nothing. Using Pyrit's file gives me the error:"[!] Could not initialize landscape shader! Fehler beim Landschaftsgenerator."

Using the last snapshot (32bit), the posted clonk.exe and tried both LandscapeShader.c linked in this thread as well.
Reply
Parent - By Clonkonaut [ie] Date 2012-08-23 14:51
Could mean that you are an interesting case for Peter ;)
Reply
Parent - - By PeterW [gb] Date 2012-08-23 14:57
Clonkonaut's shader seems to be from the default branch (doesn't mention lightTex), so no wonder it doesn't change anything. Does the log have anything more to say before that generic error message? What sort of GPU do you have?
Parent - - By Saiodin [de] Date 2012-08-23 16:49
nothing specific in the Clonk.log:

[17:47:33] Command line: G:\Program Files\OpenClonk\clonk.exe
[17:47:33] OpenClonk Beyond the Rocks Alpha
[17:47:33] Version: 5.2.90 [cb475e689a7d] Alpha win-x86 (cb475e689a7d)
[17:47:34] Grafik wird geladen...
[17:47:34] WARNING: Unknown bit name: MenuSelect (in line 564, PlayerControls.txt)
[17:47:39] Spiel deinitialisiert.
[17:47:39] Engine heruntergefahren.

I have a Nvidia Geforce GTX 680, 4GB RAM, overclocked
Reply
Parent - - By PeterW [gb] Date 2012-08-23 19:21
This doesn't look like you started a scenario. 5 seconds you spent in the main menu don't really tell me much, sorry ;)
Parent - - By Saiodin [de] Date 2012-08-24 02:09
I can't start a scenario. I get kicked back in the main menu after it loaded a bit. I don't know why it stops loading (well, actually because of the error).
Reply
Parent - - By PeterW [gb] Date 2012-08-24 10:43
What does the log look like after such a failed start?
Parent - - By Saiodin [de] Date 2012-08-24 15:11
I'm wondering why it wasn't filled correctly the last time, but here you go:
http://pastebin.com/btYmq1d4
Reply
Parent - - By PeterW [gb] Date 2012-08-24 15:46
The GLSL compiler is complaining about a lot of "<" and "/" in the shader, which isn't really using them much. Are you sure you copied it correctly? This looks a lot like you have HTML pieces left in there. Try to use the "raw" link in the gray bar up top.
Parent - By Saiodin [de] Date 2012-08-26 16:18
You're right. Now it works. Got my first crash:
http://pastebin.com/h1NBpg42
The dmp:
http://www36.zippyshare.com/v/84215395/file.html
Reply
Parent - - By Zapper [de] Date 2012-08-21 08:01
So for team-view I can just attach objects that have a view-range to all allies?
Also after having a short look at the code (to figure the above out): What happens on an owner change - it looks like a FoW-object would only remove itself from its current owner's list - and on death of a crew member the view range is not reset to 0, so the FoW is also still there?
Parent - - By PeterW [gb] Date 2012-08-21 11:29
Yes, and the whole code for attachment of the FoW-objects isn't finished at all. I just built the minimum what allowed me to test it a bit. And don't dead Clonks get this cool animation where their FoW range drops to zero eventually?
Parent - By Caesar [de] Date 2012-08-22 19:07
Looks like you found a volunteer who is familiar with your code and willing to write it?
Parent - - By Pyrit Date 2012-08-22 18:09
Is FoW deactivated by default? I tried several scenarios (tutorials, Krakatau), but there is no FoW. The landscape is updated only each second, though.
I used the latest development snapshot (32 bit) and the engine Newton compiled, but I have a 64 bit Windows. Log is here.
Parent - - By Clonkonaut [ie] Date 2012-08-22 18:11
You need the changes that are in the lights branch. Snapshots are created from the default branch. Long story short: Take the attached file and put it into Graphics.ocg
Attachment: LandscapeShader.c (4k)
Reply
Parent - - By Pyrit Date 2012-08-22 18:34
Ah thx! But I had to use this file to get it to work.
Looks really cool now!
Parent - By Clonkonaut [ie] Date 2012-08-22 18:39
Oh. Okay.
Reply
Parent - - By Mortimer [de] Date 2012-08-22 19:06
Hey, looks neat! And the lights branch also seems to fix http://forum.openclonk.org/attach_show.pl?aid=1750 for me, hooray.
Reply
Parent - - By PeterW [gb] Date 2012-08-23 00:20
What about that does it fix? o_O
Parent - - By Mortimer [de] Date 2012-08-23 06:55
Reply
Parent - By Newton [de] Date 2012-08-23 10:47
conclusion: more shaders => less graphics issues
Parent - By PeterW [gb] Date 2012-08-23 14:05
Default is that the landscape is yellow?

Something I changed - more or less by accident - is that for the lights branch, BROKEN_ARRAYS_WORKAROUND is now permamently on, as I couldn't get it to run without it for some reason.
Parent - By Pyrit Date 2012-08-22 20:00
Wow, that's just great! A milestone in clonk history!^^
I have played a few rounds and expierienced 2 crashes. In the 2nd tutorial and Krakatau. Here's the Log.
- - By PeterW [gb] Date 2012-07-28 21:11
Carlo's son Iltu  in psychedelic debugging land. Still a few kinks to work out.

Parent - - By Zapper [de] Date 2012-07-28 21:54
I want to be able to switch into that mode
Parent - - By PeterW [gb] Date 2012-10-15 15:54
Btw - you can now activate that mode by turning on debug mode and pressing Ctrl-F7 four times. You're welcome ;)
Parent - By Zapper [de] Date 2012-10-15 21:15
Cool!
Parent - - By Pyrit Date 2012-08-02 22:22
As I'm not technically gifted, I have a question on this. Would it be possible to add an object like a lantern to the system? Like when the clonk holds a lantern, while he is in a cave, the sight range increases. That would be really cool.
Parent - - By PeterW [gb] Date 2012-08-03 00:03
Absolutely.

Once I get this done properly, at least. For anyone wondering: The current stuck-up is that I really don't want material that's close to the Clonk to cast too huge shadows. Basically, at that point it really shows that I'm only faking the light having a size. I was trying to achieve this by "shrinking" the light for closer rays, but it turns out I can't just do that without violating some assumptions the rest of the code makes. Argh, messy.
Parent - - By Caesar [de] Date 2012-08-03 13:36
Keep it simple? Ignore material on the first 20 pixels?

Ah, btw, are the shadows updated every frame? Would it look good to give the clonk a flashlight and let that bounce up and down a little when he walks?
Parent - - By PeterW [gb] Date 2012-08-03 14:17
That's one of the options I'm exploring. Makes everything explode even worse though :/

And yes, they are updated every frame. However, I'm currently "smoothing" it by alpha-blitting the old light map over it every frame. That makes it look better, as it covers up some jitter due to everything being pixels at some point - when you stand directly in front of something, even small bumps in the ground the Clonk is walking over might cause significant changes in shadows.

So this kind of effect might be less visible.
Parent - - By PeterW [gb] Date 2012-08-05 13:19 Edited 2012-08-05 13:24


To illustrate - if I assign an over-sized light to the Clonk and set the algorithm to ignore any material within double the size of the light, we get something like this - the light is still big enough that it sees material that is far away but below the light as still party shadowed by my faked big-light algorithm.

The shape is also really coarse and unstable.



Here's what I was using before: By scaling the light down I get a much more natural progression. I really like the look of this better, but - as I said - it violates some assumptions. Specifically, now we might have situations where the transitive property "if A shadows B and B shadows C, A also shadows C" doesn't hold anymore. And I'm pretty sure that the best I could do would be to try to push these cases off-screen :/

(oh yeah, and in case anybody is wondering - in the screenshots, the red line is the surface of "full visibility", and the yellow one for "no visibility")
Parent - - By Sven2 [de] Date 2012-08-05 13:59
Maybe it's obvious to you, but why are there gaps of fog pointing inwards from the two 45 degree angles downwards?
Up Topic Development / Developer's Corner / Screenshot log 2: Lights
1 2 3 4 5 Previous Next

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill