Commit Graph

8534 Commits (objectmenu)
 

Author SHA1 Message Date
Armin Burgmeier 1349962ac3 Fix release build 2016-01-17 13:36:26 -08:00
Armin Burgmeier d387fdb270 Fix mesh rendering for meshes with more than one submesh
The buffer offset was encoded in the VAO which would be shared across all
submeshes. Instead, don't encode the buffer offset into the VAO but apply it
with glDrawElementsBaseVertex().
2016-01-17 11:37:17 -08:00
Günther Brammer fd61ac7ebe Remove unused IsRenderTarget and MaxTextureSize C4Surface options
They were always false and 0.
2016-01-17 11:37:17 -08:00
Armin Burgmeier b459cb35f1 Remove the OpenGL version check
As long as we can create a core profile context we are good anyway.
And if we don't, we'll get an error during context construction.
2016-01-17 11:37:17 -08:00
Armin Burgmeier ab6152e48c Create an OpenGL core profile context on Windows
I didn't actually test this, but shamelessly stole the code from Isilkor's
opengl-3.2 branch.
2016-01-17 11:37:17 -08:00
Armin Burgmeier e856720e21 Use a OpenGL core profile on Mac OS X
Also, remove obsolete checks for shader support.
2016-01-17 11:37:17 -08:00
Armin Burgmeier d7d24ca36a Enable OGL core profile for linux 2016-01-17 11:37:17 -08:00
Armin Burgmeier e13cda4bd0 Use an IBO for the particle system
glDrawElements needs an IBO when using a core profile. The particle
system's IBO is actually quite static since it's always a triangle
strip with 2 triangles followed by a PRI. Therefore, this reduces the
amount of data we have to send to the GPU compared to the previous
solution.

Also, remove the workaround when glPrimitiveRestartIndex is not
available since it is always available with OpenGL 3.1 and when using
a core profile we are guaranteed to have OpenGL 3.1 anyway.
2016-01-17 11:37:17 -08:00
Armin Burgmeier 686a32764c Use an IBO to render the FoW 2016-01-17 11:37:17 -08:00
Armin Burgmeier 6bda0b4ec8 Use an element array buffer (IBO) for meshes
This is required for glDrawElements() with a core profile. Furthermore, for
meshes that have a fixed face ordering (non-transparent meshes at 100%
completion), this puts more static data on the GPU that we don't have to
upload every frame.

For meshes with non-fixed face ordering, we still have to upload faces every
frame, since the ordering might change if the mesh rotates. We could still
improve this by figuring out if the order actually changed after the sort
step, and only update to the GPU if it has. In many cases it hasn't, so there
is some potential for more optimization there. But that's for later.
2016-01-17 11:37:17 -08:00
Armin Burgmeier 442241dc3e Remove adjusting texture sizes to next power of two
This code was basically never used anyway, since the
ARB_non_power_of_two extension is always available since OpenGL 2.0.
The GLEW check for the extension fails however as soon as we select
a OpenGL 3 core profile, and the texture sizes will be unnecessarily
adjusted again.
2016-01-17 11:37:17 -08:00
Armin Burgmeier aef7538aa1 Switch shader code to OpenGL 3 style 2016-01-17 11:37:17 -08:00
Armin Burgmeier 16d2eb5cb1 Use the core api for shaders instead of the ARB one 2016-01-17 11:37:17 -08:00
Armin Burgmeier bc8db0589e Make the mesh material properties uniform variables
Instead of relying on the obsolete glMaterial call.
2016-01-17 11:37:17 -08:00
Armin Burgmeier 2c2c3f98c8 Switch framebuffer API to OpenGL core API 2016-01-17 11:37:17 -08:00
Armin Burgmeier 5de1bc70a9 Remove a stray glClientActiveTexture call 2016-01-17 11:37:17 -08:00
Armin Burgmeier 28aa1d1812 For each VBO, use a VAO to render it
For OpenGL 3.2 core compatibility, and to reduce the number of state
changes during rendering.
2016-01-17 11:37:17 -08:00
Armin Burgmeier fabb4cbdbf Implement a mechanism that allows using VAOs across contexts
Basically add another layer of indirection around accessing VAOs. The problem
is that VAOs are not shared between OpenGL contexts. This mechanism allows to
treat them mostly as if they were shared if they are only accessed through
the API defined in CStdGL.

This is accomplished by caching all existing VAOs per context. If a VAO is
being accessed, it is checked whether that VAO exists in the currently
selected context. If yes, return it, otherwise create a new VAO and return it,
together with a flag that indicates that the VAO needs to be initialized.
2016-01-17 11:37:17 -08:00
Armin Burgmeier fa9f4c6356 Replace GL_GENERATE_MIPMAP flag by glGenerateMipmap call
The former is not available in a OpenGL 3 core profile, but glGenerateMipmap
is available since OpenGL 3.0, and so is always available when we have a
core profile.
2016-01-17 11:37:17 -08:00
Armin Burgmeier bb8b933417 Revert "Revert "Replace 3D texture in landscape shader by a 2D texture array""
This reverts commit 4a02d3c77b.

This was merged into master even though I only wanted it in stable-7.0.
Oh well, let's just revert it again.
2016-01-17 11:37:17 -08:00
Sven Eberhardt 729712fa2f Allow use of bucket, pickaxe, bow, club, grenade launcher, javelin and musket during scale/hangle.
Temporarily disables scale/hangle during usage of these items.
2016-01-17 14:31:51 -05:00
Sven Eberhardt 418964f6e8 Hot Ice: Spawn and map improvements in "small islands" mode #1623 2016-01-17 12:22:20 -05:00
Nicolas Hake dd33f8ea31 Merge pull request #10 from pkern/master
Correct the spelling of my name in Credits.txt
2016-01-17 14:08:14 +01:00
Philipp Kern 904299cec5 Correct the spelling of my name in Credits.txt 2016-01-17 13:49:57 +01:00
Maikel de Vries 5b111131e9 remove unused is wallkick effect 2016-01-17 13:30:01 +01:00
Maikel de Vries 7ca450b6b2 fix script errors for wrong parameter types in iron bomb effects 2016-01-17 12:51:04 +01:00
Maikel de Vries 5881018cb4 tutorials: hide guide message while in a dialogue (#1593) 2016-01-17 12:39:24 +01:00
Maikel de Vries d607824df2 fix dialogue stopping and waiting time (#1597)
First stop the dialogue properly and then wait for 30 frames to start a new one.
2016-01-17 12:37:42 +01:00
Maikel de Vries 79e0402683 fix script error for wrong paremeter type in Crash.ocs waterfall effect 2016-01-17 12:35:47 +01:00
Maikel de Vries 1ab3fdc104 tutorial 3: lumberjack directs to other villagers when needed (#1596) 2016-01-17 09:32:36 +01:00
Maikel de Vries cbc37ebb79 make sawmill site uncancellable in tutorial 3 (#1617) 2016-01-17 09:11:01 +01:00
David Dormagen 368eb698ec pickaxe: removed debug message
introduced in https://git.openclonk.org/openclonk.git/commitdiff/796aa7d7c62c5348417d584c9637da61297736d4
2016-01-17 08:11:17 +01:00
Sven Eberhardt 234d4b365c Maze: Fix possible spray line to last position or (0,0) landscape corner #1624 2016-01-16 22:38:45 -05:00
Sven Eberhardt afab6ef464 func PlayerControl: Send nil instead of 0 for non-mouse controls.
The main script function always assumed this, but it was not actually implemented that way.
2016-01-16 22:06:19 -05:00
Sven Eberhardt 5f713e7bb9 Maze: Fix error sound when trying to cheat 2016-01-16 22:03:35 -05:00
Sven Eberhardt 0b6e2015cf Fix shovel shoveling in the wrong direction sometimes #1626 2016-01-16 22:02:32 -05:00
Sven Eberhardt 796aa7d7c6 Fix pickaxe picking in the wrong direction sometimes #1626 2016-01-16 22:02:08 -05:00
Sven Eberhardt 0a9cf34e77 Win32 editor: Allow resizing of main console window #1601 2016-01-16 21:01:11 -05:00
Sven Eberhardt f1c4273bb9 Win32 editor: Allow resizing of property window #1601 2016-01-16 19:56:24 -05:00
Sven Eberhardt 148073a956 Fix black NO_OWNER viewport in network mode. 2016-01-16 16:29:23 -05:00
Sven Eberhardt 0b3c29a95c Extinguish transferred contents on respawn 2016-01-16 14:07:20 -05:00
Günther Brammer a5af9089a8 Script: Check parameter types of engine callbacks, too
This prevents a crash when an incompatible engine function is used as an
engine callback function.

Unfortunately, this breaks any scripts that have wrong type information in
engine callbacks and only worked because those were ignored.
2016-01-16 18:26:18 +01:00
Sven Eberhardt 915ae02178 Crash landing: Fix post-intro plane placement so it cannot slide into the lava #1615 2016-01-16 12:21:17 -05:00
Tobias Zwick 2cd5236339 fix problems with scenarios after having added the shape textures 2016-01-16 16:57:15 +01:00
Tobias Zwick 18c64e7052 correct normals of earth textures (green channel was inverted) 2016-01-16 16:57:15 +01:00
Tobias Zwick 996ce06ab4 finetuning shape defs 2016-01-16 16:57:15 +01:00
Tobias Zwick a5610b9458 add scenario for website header 2016-01-16 16:57:15 +01:00
Tobias Zwick dfa21c5d26 reorder materials so i.e. sand does not paint over a rock shape anymore.
* all non-diggable materials are now in front of diggable materials
* except: firestone and coal are still in front of rock

At least this change makes it necessary to test every scenario we have if there are any problems with the landscape
2016-01-16 16:57:15 +01:00
Tobias Zwick c10a968eb1 fix tiling of the gold normal texture 2016-01-16 16:57:15 +01:00
Tobias Zwick a0f3bed4d1 add new shape and normal textures to hideout.ocs 2016-01-16 16:57:15 +01:00