Commit graph

354 commits

Author SHA1 Message Date
Pawel Kolodziejski
0db12d7062 GRIM/EMI/MYST3: drop usage for GLU functions for replacements 2014-07-10 07:29:01 +02:00
Pawel Kolodziejski
6625530d88 JANITORIAL: fix whitespaces 2014-07-10 07:23:47 +02:00
Pawel Kolodziejski
b7e887911a GRIM: Don't put OpenGL vendor/driver name in window title. Now it wrote in debug console. 2014-07-06 11:18:35 +02:00
Joni Vähämäki
88ec1d5285 EMI: Implement lighting for OpenGL Shaders renderer. 2014-07-05 14:09:56 +03:00
Joel Teichroeb
5f87912e91 Merge pull request #949 from Akz-/grim-quat
GRIM: Use quaternions for animation.
2014-07-04 10:45:32 -07:00
Joseph Jezak
e8d5fc649c GRIM: Remove usage of _currentQuat since it's just an identity. 2014-07-04 12:53:34 -04:00
Pawel Kolodziejski
2bf63a5f52 GRIM/EMI: synced OpenGL and TinyGL a bit more 2014-07-03 21:55:10 +02:00
Pawel Kolodziejski
8a1e63abeb GRIM: formatting 2014-07-03 21:02:01 +02:00
Joni Vähämäki
dbfec3b1e8 GRIM: Use quaternions for animation. 2014-07-02 22:29:37 +03:00
Christian Krause
565f488c58 GRAPHICS: Refactoring
Rename some variables and functions of the graphics drivers to distinguish properly betwen textures and materials.
2014-07-02 02:07:06 +02:00
Joel Teichroeb
0e69cc11a7 Merge pull request #938 from Akz-/emi-sprite-fixes
EMI: Sprite fixes
2014-06-25 17:30:36 -07:00
Joni Vähämäki
fdd4cb2675 EMI: Clean up sprite drawing in OpenGL. 2014-06-23 22:34:49 +03:00
Joni Vähämäki
33b32470d7 EMI: Read depth write and alpha test flags from sprite files. 2014-06-23 22:34:47 +03:00
Joseph Jezak
55f77fb92f EMI/GRIM/MYST3: Replace some Quaternions with Rotation3D. 2014-06-23 09:24:26 -04:00
Joni Vähämäki
3232b9cb4d EMI: Draw model faces with alpha textures also to the depth buffer. Fixes #874 2014-06-22 14:19:56 +03:00
Joni Vähämäki
83ed05c269 EMI: Read vertex color values from sprite files.
This makes the coals in wed more transparent, matching the original game better.
2014-06-22 14:19:56 +03:00
Joni Vähämäki
59e60654f8 EMI: Add support for additively blended sprites. 2014-06-22 14:19:54 +03:00
Christian Krause
58833e15f0 EMI: Change frustum parameters for Overworld actors
- lower the distance to the near plane of the frustum for Overworld
  and change the other parameters accordingly

- this makes the following actors visible:
 - background of directions to Pegnose Pete's house (issue #869)
 - Murray in the murray_go easter egg
 - the trophies during the diving contest (upper left corner)
 - the screenshots for the save games (still with the wrong texture)
2014-06-21 23:59:07 +02:00
Christian Krause
bf8501fd37 EMI: Clear depth buffer before starting to draw the Overworld
- all actors of the Overworld should cover any non-Overworld drawings
- Overworld actors need to use the depth buffer so that e.g. the
pause screen is drawn above the inventory

- this fixes issue #927 (inventory is drawn above background of pause
  or menu screen)
2014-06-21 23:59:07 +02:00
Joel Teichroeb
a539832c78 Merge pull request #910 from JoseJX/FixGLTextureParams
EMI: Clamp sprites, repeat other textures.
2014-06-20 08:30:44 -07:00
Joseph Jezak
df3d63fc24 EMI: Add support for clamping sprite textures and repeating other textures. 2014-06-18 22:19:42 -04:00
Joni Vähämäki
b5cdd1240f EMI: Only draw models for actors inside the view frustum.
This adds math classes for doing frustum culling in software. These could be used for optimizing performance in many other places as well. For example, if an actor is outside the view frustum, it may not be necessary to do expensive keyframe animation and vertex skinning calculations for that actor.
2014-06-16 15:42:18 +03:00
Joni Vähämäki
8f9f541f17 EMI: Implemented dynamic lighting for models.
Lighting is done by calculating vertex colors in software, since the attenuation model used in EMI cannot be simulated with OpenGL fixed function lighting. The original game does the lighting this way as well. Ideally for the modern shader-based renderer a shader would be used for this instead.
2014-06-16 15:41:06 +03:00
Joni Vähämäki
d80c84ad97 EMI: Enable backface culling. Fixes #900 2014-06-10 22:51:24 +03:00
Vincent Pelletier
b2fcde697a GRIM: Set a spot exponent to simulate DirectX's penumbra.
Effect is especially visible near set do's window.
2014-06-01 23:13:10 +02:00
Vincent Pelletier
446c40384f GRIM: Use specular lighting.
A few sets where spot lights are present: hq (elevator, projector),
do (window), al (light above garage door).
2014-06-01 23:13:03 +02:00
Vincent Pelletier
f9bc96a649 GRIM: Always set light's GL_SPECULAR. 2014-06-01 23:13:00 +02:00
Vincent Pelletier
38dbea6082 GRIM: Replace intensity divisor with attenuation. 2014-05-31 17:04:02 +02:00
Vincent Pelletier
bc520bc5e1 GRIM: Disable GL_LIGHT0's default specular component. 2014-05-31 17:04:01 +02:00
Vincent Pelletier
d7ebff2ac3 GRIM: Use GLfloat instead of float when passed to gl* functions. 2014-05-31 17:04:01 +02:00
Joel Teichroeb
0f3da43694 GRIM: Change NULL to nullptr. 2014-05-30 17:43:08 -07:00
Dries Harnie
5c0d145509 EMI: Fix dark lines in the intro
Taken from #854 and #735.
2014-05-29 13:58:51 +02:00
Dries Harnie
9ec4a897ee MISC: Fix typo in comment 2014-05-05 15:00:39 +02:00
Christian Krause
47251c0c09 EMI: Change drawing order of faces
If multiple faces of one model are referring to the same triangles, let
them overwrite each other so that the latest one will be visible. For
this purpose glDepthFunc is changed from GL_LESS to GL_LEQUAL so
that subsequent drawing attempts for the same triangle are not ignored by
the depth test.

This fixes the issue of the colored leg of the monkey bot in the end
scenes: the leg is drawn using color maps by the first face and using
textures by a following face.
2014-05-03 00:22:35 +02:00
Pawel Kolodziejski
8759900b6a ALL: synced with ScummVM 2014-04-05 18:18:42 +02:00
Joel Teichroeb
a010e06bec GRIM: Make data in MeshFace private 2014-03-30 14:38:52 -07:00
Christian Krause
03bc169e51 GRIM/EMI: Fix compile issue with mingw32
- don't use glMultTransposeMatrixf since it is not available on all
  platforms (better transpose matrix in residualvm and use
  glMultMatrixf)
2014-02-16 11:57:15 +01:00
Christian Krause
5577bd71b7 Merge pull request #833 from chkr-private/compiler-warning-fixes
EMI/GRIM/TINYGL: fix compile warnings and coverity issues
2014-02-15 18:50:59 +01:00
Christian Krause
6acf4984d0 GRIM/EMI: Use proper GL constants 2014-02-15 18:40:30 +01:00
Christian Krause
446f56eb67 GRIM/EMI: Fix compile warnings 2014-02-15 18:40:19 +01:00
Christian Krause
58d7bf116c EMI/GRIM: Fix rotation of attached actors
Use matrix multiplications to fix the rotation for attached actors:
- calculate the final transformation matrix recursively for attached
  actors (instead of using getWorldPos and getWorldRot)
- use a different order for building the quaternions out of the Euler
  angles
- changed handling of camera position (just apply the rotation of the
  camera, the (inverted) position of the camera and the position of the
  actor
- no functional changes for GRIM
- no changes for drawing in overworld

Code simplification for GRIM:
- no need to use _currentPos in calculations for GRIM since it is
always (0, 0, 0)

This fixes:
- the rotation of any items Guybrush is holding in his hands
- the handling of the pole when using the raft in the swamps
- getting the bananas with the banana picker
2014-02-05 21:35:02 +01:00
Dries Harnie
5da8aa7144 GRAPHICS: Introduce GfxOpenGLS 2014-01-14 00:26:39 +01:00
Joel Teichroeb
850f576082 Merge pull request #812 from chkr-private/sprite-fixes
EMI/GRIM: Fix unaligned sprites
2014-01-11 18:35:39 -08:00
Christian Krause
3f7d7df273 EMI/GRIM: Fix unaligned sprites and use correct axis
When an actor which is drawn using sprites moved due to water float
effects and if that actor uses multiple sprites, then these sprites are
not aligned (e.g. in the very first scene, the ship in the background is
not shown as one piece).

That is because the sprites are first rotated and then moved to
the correct position. It is necessary to first move them to their
correct position on the actor and then rotate the whole actor.

Additionally, non-overworld sprites needs to be rotated by the Yaw axis.
Otherwise the ship did not rock but only moved vertically.

This changes fixes:
- the ship in the background in the first scene
- the clock hands in the swamp
2014-01-11 23:58:49 +01:00
Ingo van Lil
f106a2a8b9 GRIM/EMI: Fix sprite scaling with non-native screen resolutions
When mapping a sprite to a GL polygon its dimensions are scaled by the ratio
between the current screen resolution and the native game resolution. When
the polygon is rendered it is scaled again, causing sprites to be displayed
unproportionally big when using larger screen resolutions.
2014-01-09 23:32:47 +01:00
Ingo van Lil
ea6ffdb934 EMI: Flip y coordinate when creating screenshot textures
The MakeScreenTextures() opcode is used to create texture tiles from the
current screen content for use with an overworld actor, e.g. when fading over
the slides in the intro. With OpenGL the created textures were mirrorered in
y direction because OpenGL uses a different coordinate system where (0, 0)
is the bottom left corner.
2013-12-22 20:11:39 +01:00
Dries Harnie
9edcb2fd67 JANITORIAL: Add FIXME about refactoring cf. #789 2013-12-17 01:09:18 +01:00
Dries Harnie
180b4659b9 Merge pull request #789 from sietschie/master
EMI: Place text when actors talk
2013-12-16 16:05:12 -08:00
sietschie
d06762ec52 EMI: removed unnecessary comments, made getBoundingBox const 2013-12-12 14:46:53 +01:00
Einar Johan Trøan Sømåen
a11670047a EMI: Apply alpha when drawing sprites.
This fixes the health bars in Monkey Kombat.
2013-12-12 03:36:21 +01:00