Sven Eberhardt
baf05264d1
Implement music fading.
...
Moved music system execution from game tick execution into main application execution so music fading works when the game is paused or lagging.
2014-12-06 18:04:55 +01:00
Tobias Zwick
1ad16efe23
fix intermediate fade point sometimes end up overlapping the fan
2014-12-06 01:44:18 +01:00
Sven Eberhardt
62e6da2f23
Add categories for .ogg music files that can be referenced in SetPlayList.
2014-12-06 00:06:08 +01:00
Mark
d0a74d9af3
Merge remote-tracking branch 'origin/master'
2014-12-03 20:08:41 +01:00
Mark
0e9c0e9be4
AttachMesh with added functionality ( #1177 )
...
Simple implementation of matching skeletons/animations. Short description added to the documentation. More functionality to follow.
2014-12-03 20:05:36 +01:00
Mark
dda9599003
Extracted skeleton from StdMesh.
...
Skeleton is now represented by the class StdMeshSkeleton.
2014-12-03 20:04:54 +01:00
Armin Burgmeier
a792a1c6a2
Fix possible race condition in C4ParticleSystem construction
...
Previously, the calculation thread was initialized before the event it was
going to wait for after it is launched. However, since the thread starts its
execution in its constructor, it might access the event before the event
itself has been constructed.
This is fixed by making sure the event is fully constructed before the thread
is constructed (and launched).
2014-12-03 11:03:51 -05:00
Armin Burgmeier
89f8fb9fef
Add (auto-generated) normal maps for most resources
2014-11-26 17:58:52 -05:00
Armin Burgmeier
254e1e4631
Apply drawtransform on sprite normal map
...
This makes the normals point into the correct direction for transformed
objects, which is for example the case when they are rotated with SetR.
2014-11-26 17:56:43 -05:00
Armin Burgmeier
a206531534
Add documentation for the Normal.png file
2014-11-25 12:47:57 -05:00
Armin Burgmeier
e58b62920c
Change extension of shader files from .c to .glsl
2014-11-25 11:54:36 -05:00
Armin Burgmeier
5054322b6d
Enable lighting shaders for particle rendering
2014-11-25 11:42:17 -05:00
Armin Burgmeier
56b19ac065
Fix brush preview in GTK+ developer mode
...
This looks like an artifact from when the alpha channel was inverted.
2014-11-24 16:32:25 -05:00
Armin Burgmeier
192dddec6f
Use the new shader system for rendering sprites
...
This now also avoids the use of conditionals in shaders by using different
shaders instead.
2014-11-24 14:51:08 -05:00
Armin Burgmeier
a06e5a4aee
Add some more variants of the uniform setters
2014-11-24 14:51:08 -05:00
Armin Burgmeier
5c6ed34a3a
C4Shader: Deactivate shader units in reverse order
...
This makes sure that GL_TEXTURE0 is the active texture unit
after the shader call. Some parts of the engine such as the
particle system rely on that.
2014-11-24 14:51:08 -05:00
Armin Burgmeier
292f8e8191
Improve GL error outputs
2014-11-24 14:51:08 -05:00
Armin Burgmeier
a7f9ba1e91
Compute ambient texture coordinate based on fragment coordinate
...
This will allow to use the same shader slice also for the sprite and mesh
shaders.
2014-11-24 14:51:08 -05:00
Armin Burgmeier
f550fcdf43
Add C4Draw::GetClipRect()
...
This will allow to avoid some code duplication when computing the coordinate
transform from fragment coordinates to ambient and light texture coordinates.
2014-11-24 14:51:08 -05:00
Tobias Zwick
3483d1f367
fix clipping problem for real
2014-11-23 22:50:49 +01:00
Tobias Zwick
117758848c
Revert "fix clipping bug during the raytracing phase" (no fix after all)
...
This reverts commit 7a47c95c08
.
2014-11-23 21:33:28 +01:00
Tobias Zwick
7a47c95c08
fix clipping bug during the raytracing phase
2014-11-23 21:23:58 +01:00
Peter Wortmann
e0ce489587
Treat light values below a certain threshold as darkness
...
This is the "lazy" fix for the problem that lightness never returned to
full zero. On the other hand, it probably is also the right one - after
all, with smoothing the last 8 or so light intensity values are lost to
us anyway.
2014-11-23 20:03:57 +01:00
Tobias Zwick
43d7bbfa73
make Peter's change conform to the naming scheme
2014-11-23 18:39:24 +01:00
Tobias Zwick
256c86fccd
Merge remote-tracking branch '_origin/lights' into lights
...
Conflicts:
src/landscape/fow/C4FoWLight.cpp
src/landscape/fow/C4FoWLight.h
2014-11-23 18:06:10 +01:00
Tobias Zwick
3a8fb34bea
shorten and make intermediate fade triangle render code more performant
2014-11-23 17:50:21 +01:00
Tobias Zwick
a1794359cc
squash and simplify function to find cross-intersection again
2014-11-23 17:49:29 +01:00
Tobias Zwick
e33ef90bba
fix a bug in the intermediate fade triangle render code
2014-11-23 17:46:59 +01:00
Tobias Zwick
8850d2e755
replace algorithm to calculate the intermediate fade point with a more failsafe version
2014-11-23 17:45:53 +01:00
Tobias Zwick
294838e0a4
outsource translating coordinates of triangles into a function
2014-11-23 17:42:09 +01:00
Tobias Zwick
800885a21b
add const keyword to some methods
2014-11-23 17:40:24 +01:00
Peter Wortmann
7dd4d1900b
Split fan where the normal maxes out
...
This gives a more consistent normal distribution across directions.
I actually had to make the "normal region" of the light bigger, because
now the Clonk's face would be all dark otherwise. In the end,
everything looks smoother and less flashy now, which is probably as
it should be.
Also slight refactoring.
2014-11-21 15:32:33 +01:00
Tobias Zwick
6bd5beafde
make certain fades a bit smoother by reimplementing PeterW's NEWER_INTERFADE_CODE. This is only a very slight effect, but visible
2014-11-20 23:43:14 +01:00
Tobias Zwick
1b96eaabf2
move find_cross function to a different class, reimplement
2014-11-20 23:43:13 +01:00
Tobias Zwick
815a61c540
fix a bug in intermediate fade generation
2014-11-20 23:43:12 +01:00
Armin Burgmeier
db6df15377
Add SetAmbientBrightness and GetAmbientBrightness script functions
2014-11-20 17:07:31 -05:00
Armin Burgmeier
d60c74c6b6
Fix viewport offset for lightmap lookup
2014-11-20 16:45:34 -05:00
Peter Wortmann
9672ae8947
Framebuffer update improvements
...
Now we use the shader to do a proper blend - this avoids some artefacts
that were visible before. Also after some hair-pulling the coordinate
transformation now seems to be more correct than before. Maybe even
with zoom. We'll see.
2014-11-20 21:48:46 +01:00
Peter Wortmann
7fea618221
Collected trivial bug-fixes
...
Turns out we actually can't optimise out the second texture normal
lookup - it makes a noticeable difference in-game. Also there was
possible slice collision, it might be worth warning about this kind
of stuff.
Also removed unused variable, and made error messages more consistent
in terms of whitespace.
2014-11-20 21:44:11 +01:00
Peter Wortmann
72289713f9
Modular shader system
...
The idea here is that we compose shaders out of "slices", which can
come from the engine ("built-in"), from files or possibly even from
models. This should allow us to more easily share the code between
different rendering shaders (e.g. for lights / normals).
TODO: Workarounds not yet implemented, so this might degrade less
gracefully.
2014-11-20 11:52:14 +01:00
Armin Burgmeier
b43e1a9369
Fix ambient texture coords when viewport is smaller than full render target
2014-11-18 16:44:06 -05:00
Armin Burgmeier
48456f5f99
Fix transparency in regions with no ambient and low dynamic light
2014-11-18 16:33:27 -05:00
Armin Burgmeier
2df2ee22d6
Update ambient map on landscape changes
2014-11-18 15:42:53 -05:00
Armin Burgmeier
643ca7fd0a
Add functionality to update the ambient map at runtime
2014-11-18 15:42:39 -05:00
Armin Burgmeier
39f5b6f15a
Apply landscape re-lighting again in every frame
...
This was accidentally removed in commit
56bdeec585
. It fixes the landscape being
only updated once every second when digging.
2014-11-18 15:42:22 -05:00
Armin Burgmeier
ac75c7041b
Remove two unused declarations in C4Landscape
...
There are no implementations anymore for these.
2014-11-18 15:42:22 -05:00
Armin Burgmeier
5ac6ea6a3c
Fix FoW deinitialization in C4Landscape
2014-11-18 15:42:22 -05:00
Armin Burgmeier
c8ea5d1f85
Explain the one-second relights in a comment
...
Should make it a bit quicker for the next person to figure out what is
going on there...
2014-11-18 15:42:22 -05:00
Armin Burgmeier
72255a7e04
Optimize generation of the ambient map
...
The new algorithm is ~25% faster
2014-11-18 11:06:26 -05:00
Armin Burgmeier
ee33c58cfe
Don't apply the dot product to transparency in lighting calculation
...
This fixes the transparency issue with the coconut tree.
2014-11-17 20:51:18 -05:00