Can you please test the current 15 again? There are 60 trees in a row, Gold Rush contains 30.
Ashes: I only forgot to draw tunnel as an underground material in the scenario.
Ashes: I only forgot to draw tunnel as an underground material in the scenario.
Yes, 38 FPS for me now! But people with worse hardware should test it as well I guess.
The trees did not decay to ashes currently, so I could not test that. Also when my clonk is on fire and I stand in front of a tree that fire starts at the trees centre, I would expect it to start close to the clonk, this looks odd.
Also where did the fire bombs go? I think it would be nice to have something (which does not look like firestones) with the same functionality in OpenClonk.
The trees did not decay to ashes currently, so I could not test that. Also when my clonk is on fire and I stand in front of a tree that fire starts at the trees centre, I would expect it to start close to the clonk, this looks odd.
Also where did the fire bombs go? I think it would be nice to have something (which does not look like firestones) with the same functionality in OpenClonk.

[16:04:20] WARNING (particle system): Your graphics card does not support glPrimitiveRestartIndex - a (slower) fallback will be used!
[16:04:20] Grafik wird geladen...
[16:04:21] FATALER FEHLER: Fehler beim Initialisieren der GLSL-Shader
Anyone interested in the OpenClonkShader.log? Although I think not. :)
> Anyone interested in the OpenClonkShader.log?
Hm, there might be a more meaningful error message in there. If not, we should definitely log the shader compile/link error string as well...
So the error message is
I think it relates to this line:
But it is not clear to me why it does not work. My Intel driver works with it. Can you try to replace this line by
in Graphics.ocg/ObjectLightShader.glsl? Also, you'll have to replace
by
in Graphics.ocg/AmbientShader.glsl.
ERROR: 0:74: '=' : cannot convert from '3-component vector of float' to '2-component vector of float'
I think it relates to this line:
vec2 lightCoord = lightTransform * vec3(gl_FragCoord.xy, 1.0);
But it is not clear to me why it does not work. My Intel driver works with it. Can you try to replace this line by
vec2 lightCoord = (lightTransform * vec3(gl_FragCoord.xy, 1.0)).xy;
in Graphics.ocg/ObjectLightShader.glsl? Also, you'll have to replace
float ambient = texture2D(ambientTex, ambientTransform * vec3(gl_FragCoord.xy, 1.0)).r * ambientBrightness;
by
float ambient = texture2D(ambientTex, (ambientTransform * vec3(gl_FragCoord.xy, 1.0)).xy).r * ambientBrightness;
in Graphics.ocg/AmbientShader.glsl.

Attachment: OpenClonk.log (3k)
Attachment: OpenClonkShaders.log (54k)
Thanks, I have comitted this to the repository since it should not be harmful to modern video cards/drivers.

[16:04:20] OpenClonk
[16:04:20] Version: 6.0 win-x86 (a237caa4678c)
[16:04:20] ExePath: "C:\Dokumente und Einstellungen\frnv401\Eigene Dateien\oc snapshot\"
[16:04:20] SystemDataPath: "C:\Dokumente und Einstellungen\frnv401\Eigene Dateien\oc snapshot\"
[16:04:20] UserDataPath: "C:\Dokumente und Einstellungen\frnv401\Anwendungsdaten\OpenClonk\"
[16:04:20] Command line: openclonk.exe FireParticles_15.ocs --editor
[16:04:20] GL 3.0.0 - Build 6.14.10.5361 on Intel(R) HD Graphics Family (Intel)
[16:04:20] WARNING (particle system): Your graphics card does not support glPrimitiveRestartIndex - a (slower) fallback will be used!
[16:04:20] Grafik wird geladen...
[16:04:21] FATALER FEHLER: Fehler beim Initialisieren der GLSL-Shader
[16:04:21] Spiel deinitialisiert.
[16:04:21] Engine heruntergefahren.
>I think it would be nice to have something (which does not look like firestones) with the same functionality in OpenClonk.
Make something that looks like the iron bomb, but from clay instead of iron. Would be perfect, imo.

Core i3-2100 @ 3.10 Ghz
3,16 GB RAM
Intel(R) HD Graphics Family (Intel)
Game is running at 640x480, 32bit, no AA, no Highres Landscape
Runs at 38fps with only a few fires around, 20fps with the whole forest ablaze.

No noticable impact on performance:
- Highres Landscape
- 800x600
Crash after turning on AA and starting scenario (AA.zip)
Restarting works, AA is 4x but noticable: 32fps normal, 12 in front of burning trees.
Turning AA off again. Starting scenario crashes again (AA2.zip). Changing the AA setting crashes for me.
- 848x480 (weird because monitor doesn't handle very well, but 24 fps in front of burning trees; "ifobt")
- 1024x768: Framerate drop to 15fps (ifobt)
- 1280x960 / 1280x1024: 10fps (ifobt)
- 1600x1200: game itself drops to 30fps, 7fps ifobt; music starts skipping a lot
- 1920x1200: game still at 30, ifobt at 6 fps.
I hereby license the file AA2.zip under the CC-BY license
I hereby license the file AA.zip under the CC-BY license
v16:
- The amount of particles is lower but the sizes of shap flames are bigger. Also, the script checks how many other burning objects are around only once. That increased the FPS a bit: When I have 420 burning trees in v15 I get 19/20FPS, in v16 I have 27FPS with the same number of burning trees.
- Smoke is darker if fire strenght is stronger than 50%. Thats how it is in the current OC I think.
- A few positions corrected again.
- I tried to make the fire (especially the objects coming from the fireflint) look more like in CR. For that, I changed the color of the FlameBorder particle. It makes the fire more yellow with very red borders. My original one is way more orange in all areas. See image.
- The fire graphic has a minimum size of 10%.
- The other particle, SharpFlame, got rounder bottoms in the graphics.
- The amount of particles is lower but the sizes of shap flames are bigger. Also, the script checks how many other burning objects are around only once. That increased the FPS a bit: When I have 420 burning trees in v15 I get 19/20FPS, in v16 I have 27FPS with the same number of burning trees.
- Smoke is darker if fire strenght is stronger than 50%. Thats how it is in the current OC I think.
- A few positions corrected again.
- I tried to make the fire (especially the objects coming from the fireflint) look more like in CR. For that, I changed the color of the FlameBorder particle. It makes the fire more yellow with very red borders. My original one is way more orange in all areas. See image.
- The fire graphic has a minimum size of 10%.
- The other particle, SharpFlame, got rounder bottoms in the graphics.
Looks very nice the image. I will have a look after the 6.0 release and how we can get this into the game. It and some bugfixes could warrant a 6.1 release!
I like it very much, it is also in the spirit of the original fire!
I don't like all the improvements you made, especially on smaller and moving objects the fire looks a bit odd.
The clonk needs to special behaviour I suppose, or the particles created at a bit more random positions. For objects smaller than the clonk I would add more alpha to the particles or rather create less particles.
Still I am not so happy with the performance (27 FPS for me as well) and that forest should burn with at least the 38 FPS on a machine with half the graphics power mine has (GTX750M, 1080p no AA).
The clonk needs to special behaviour I suppose, or the particles created at a bit more random positions. For objects smaller than the clonk I would add more alpha to the particles or rather create less particles.
Still I am not so happy with the performance (27 FPS for me as well) and that forest should burn with at least the 38 FPS on a machine with half the graphics power mine has (GTX750M, 1080p no AA).

>Still I am not so happy with the performance (27 FPS for me as well) and that forest should burn with at least the 38 FPS on a machine with half the graphics power mine has (GTX750M, 1080p no AA).
If the script for the fire effect still looks similar to the one in the first versions, there is probably a lot of potential for optimizations.
I really don't think the particle rendering is the bottleneck here
In the minimal version, I summarized the code and only 1 of the 5 sharp particles is created all 4 frames. But I have a bad feeling about making the fire so much less detailed.
Image: Note that I had a small FPS drop to 35 FPS all ~5 seconds and I have 180 trees. With 120 trees constant 38 FPS. The 37 FPS with the 400 flames are constant, too.
GPU: NVIDIA GeForce 560
CPU: 3.4 ghz quad core intel core i7
Image: Note that I had a small FPS drop to 35 FPS all ~5 seconds and I have 180 trees. With 120 trees constant 38 FPS. The 37 FPS with the 400 flames are constant, too.
GPU: NVIDIA GeForce 560
CPU: 3.4 ghz quad core intel core i7

Do you want to give me the code from the screenshot above and I'll try to optimize it?
Sure everything below line 288 is new: http://pastebin.com/aEeNjdXS
Not if it could still lag for slower hardware, it could be done briefly on a different branch though, I'd favour that.
Even if you delete my SmokeReduction thingy (which reduces a few particles if other burning objects were around), my fire should be faster than the current OpenClonk fire. I can't find Smoke() but I think it spams more particles than I use for both smoke and fire...
Nevertheless, I agree that fire should be as fast as possible! Clonk Rage fire might be superior in terms of FPS.
Nevertheless, I agree that fire should be as fast as possible! Clonk Rage fire might be superior in terms of FPS.

PS: I tested it now:
500 trees: 37 FPS
500 trees with your fire: 8-10 FPS
500 trees on fire WITH EVERY
CreateParticle
removed: 10-12 FPSPPS: I noticed I was a bit unfair there - I didn't have the graphics of your particles included and so they weren't rendered :D
But at least without graphics, I could raise the FPS from 8-10 to around 25. Let's see how it works with graphics..


Can you fix the fire looking odd for a diving or jumping clonk for example?

I would at least make a special case for the clonk, since that is the main character of the game and also has most different poses.
But yes you are right, this is not an easy issue to tackle.
But yes you are right, this is not an easy issue to tackle.

The Clonk or other animals also will suffer from the fact that he has like, one bone in the head and at least 15 in each hand, so he might look more like a fire mage casting a spell than actually being on fire. Its the same problem like with the vertex density really.
One could of course solve that by specifying in the model where flames should come from. You could do so by adding special bones or submeshes or whatever. That would allow a great deal of control, but would again raise the bar for creating new objects.

In that case you would get a random location in three dimensions, but when projected to two dimensions (screen coordinates) it won't be uniform anymore. Not sure that's good or bad.
An alternative that would be uniform in 2D would be to repeatedly choose a random location within the projected bounding box of the mesh until a hit test with the mesh itself is fulfilled. Depending on the shape of the mesh, this could be much slower, though.
An alternative that would be uniform in 2D would be to repeatedly choose a random location within the projected bounding box of the mesh until a hit test with the mesh itself is fulfilled. Depending on the shape of the mesh, this could be much slower, though.
That's very nice.
I think you left some dead code now: for example fctFire is not used any more and Fire.png could be deleted, or?
Also the lag must then have been caused by the trees? Did you test setting a lot of objects without graphics on fire?
I think you left some dead code now: for example fctFire is not used any more and Fire.png could be deleted, or?
Also the lag must then have been caused by the trees? Did you test setting a lot of objects without graphics on fire?

>Also the lag must then have been caused by the trees? Did you test setting a lot of objects without graphics on fire?
No, but I checked how fast the game would run with 500 trees that were NOT burning, of course :)
Did you check how performant this current version is for you?
>I think you left some dead code now: for example fctFire is not used any more and Fire.png could be deleted, or?
Yes, I was a little reluctant to just remove all of it when I removed drawing of the fire facet - maybe we want the facet as a background when the object's picture is rendered? For example for the crew icons in the top left
I did not test performance yet, but no problems on my machine so far.
I'd suggest to remove dead code, one can always look up what has been removed in the repository.
Found an error (when I threw a fire bomb):
ERROR: using removed object.
[18:19:31] by: FxFireTimer(0,{FreqReduction = 4, Name = "Fire", blasted = false, border_active = false, caused_by = -1, chaoticspark = {...}, fire_height = 2, fire_width = 4, flameborder = {...}, height = 1, incinerating_obj = nil, maxhgt = 2, mode = 3, no_burn_decay = nil, pspeed = -1, redfiredense = {...}, sharpflame = {...}, smoke = {...}, strength = 100, width = 4},832) (/home/maikel/openclonk/repos/build/planet/System.ocg/Fire.c:430)
[18:19:35]
I'd suggest to remove dead code, one can always look up what has been removed in the repository.
Found an error (when I threw a fire bomb):
[18:19:31] by: FxFireTimer(0,{FreqReduction = 4, Name = "Fire", blasted = false, border_active = false, caused_by = -1, chaoticspark = {...}, fire_height = 2, fire_width = 4, flameborder = {...}, height = 1, incinerating_obj = nil, maxhgt = 2, mode = 3, no_burn_decay = nil, pspeed = -1, redfiredense = {...}, sharpflame = {...}, smoke = {...}, strength = 100, width = 4},832) (/home/maikel/openclonk/repos/build/planet/System.ocg/Fire.c:430)
[18:19:35]
Fire should start burning either much faster or instantly on the Flame object, since this object is used by for example the firebomb (on which I am working) to cast flames. Those flames should not have a fade in of one to two seconds.
One bug that Maikel addressed here is that some body parts of a running Clonk are too far away from the fire. Especially the legs in my opinion. Shortly before the clean version came into the game, I fixed that by merely adding "if (GetID() == Clonk) effect.fire_width += 3;" behind line 300. It is mb worth to add again.
Maybe a more general solution where an object can define a shape change in a callback would be better. In case I can have a look at it.
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill