Commit Graph
341 Commits
Author SHA1 Message Date
Paweł Kołodziejski 863548efeb Merge pull request #1261 from vpelletier/tinygl_texture_matrix
Tinygl texture matrix
2016-07-14 09:57:52 +02:00
Bastien Bouclet 420f19d6de GRIM: Remove useless assignments to g_driver 2016-07-12 06:16:35 +02:00
Vincent Pelletier 84859619f1 GRIM: Use [T]GL_LINE_LOOP to display an empty rectangle.
Reduces vertex redundancy.
In TinyGL, fixes checkbox border on Copal computer (actually, works around
yet another discrepancy between OpenGL and TinyGL on 1-pixel-thick
[T]GL_QUADS).
2016-07-11 14:52:36 +00:00
Vincent Pelletier 4c41a1e4a5 GRIM: Reduce direct framebuffer drawing with TinyGL.
Before this change, drawRectangle, drawLine and drawPolygon directly drew
to framebuffer, bypassing all TinyGL dirty-region detection and handling.
As a result, these drawings would only be visible when forcing TinyGL to
refresh the entire window.
Copy code from OpenGL renderer and do minor tweaks to make TinyGL happy.
There are still glitches (checkboxes on Domino's computer, ticket
printer digits) but something decent (correct position & size) gets
rendered.
2016-07-11 00:09:39 +00:00
Vincent Pelletier 41f50c2ba0 GRIM: Get rid of a few TinyGL-only lines.
Now that TinyGL behaves better around matrices, these lines become
superfluous.
2016-07-10 13:25:20 +00:00
Bastien Bouclet 3f295ec773 GRIM: Check at runtime that shaders are available 2016-02-06 08:53:42 +01:00
Bastien Bouclet 31715787ca SYSTEM: Add a system method for retrieving the screen framebuffer 2016-02-06 08:53:41 +01:00
Vincent Pelletier ea8245696b GRIM,EMI: Scale intensity on change instead of for each frame
Also uniformises intensity scaling factor implementation across renderers.
Maintain saved-state compatibility by computing on restore.
2016-01-01 23:07:59 +01:00
Paweł Kołodziejski 0eb20ae8d5 Merge pull request #1177 from vpelletier/for_upstream
GRIM: Assorted lighting fixes
2015-08-16 08:53:18 +02:00
Christian Krause b186c21f85 EMI: Fix wrap around of Layers/Frames
This patch makes sure, that Layer::_frame is smaller than numLayers
of the bitmap in order to prevent out-of-bounds access to
BitmapData::_layers.
2015-05-16 10:39:08 +02:00
Vincent Pelletier faad6a1fe3 GRIM: Disable quadratic attenuation for spotlights.
Enabling quadratic atenuation, even with values as low as 0.1, reduces spot
lighting too much in (at least) sets "do" (see Domino), "al" (see Manny when
walking along the garage door), "hq" (see Salvador).
Disabling is not perfect either, as attenuation can be seen (at least) in
set "tu" (see fire extinguisher), but it should be overall better.

Also, it should be noted that perfect fidelity cannot be achieved with openGL
fixed pipeline, as DirectX spotlight have two angles (0 <= phi <= theta <= pi),
atenuation being null below phi, full above theta, transitioning with a
configurable exponent between both (defaults to angle-linear). OpenGL would
correspond to phi=0 and theta=pi (ie, transition is always done between fixed
angles), plus a configurable hard cutoff.
2015-05-06 19:49:42 +02:00
Vincent Pelletier 351a4efa8a GRIM: Tweak attenuation.
Determined by enabling a single omnidirectional light (newlight9 in set
"ce", which stands at set entrance toward elevator) and comparing
luminosity level on Manny at several locations in that scene with original
software renderer.
This set is quite convenient for this comparison, as Manny position can be
easily controlled: stick to the wall with the red arrow pointing at the
stairs, making movements one-dimensional.

For spotlight, set "tu" was used with the single spotlight on, walking
from the fire extinguisher to server door, confirming similar attenuation.

From these tests, it seems only quadratic attenuation is used, which makes
sense as it gives a realistic effect.
2015-05-06 19:49:42 +02:00
Vincent Pelletier 06e7aa68b0 GRIM: Correct diffuse reflectance.
Determined by keping a single directional light source enabled, as they are
not subject to attenuation (having no position), and comparing with
original software renderer.
Default DirectX material reflects all diffuse light, so 1.0f coefficient is
likely correct.
2015-05-06 19:49:42 +02:00
Vincent Pelletier f36d2b62f8 GRIM: Drop TinyGL-only intensity divisor.
Also, divide intensity once instead of once per component.
2015-05-06 19:49:42 +02:00
Vincent Pelletier 5c0d8ae30e GRIM: Set correct cutoff angle now that TinyGL renders spots correctly.
Also, set (T)GL_SPOT_EXPONENT as in OpenGL renderer.
2015-05-06 19:49:42 +02:00
Christian Krause d7e7ee214d GRAPHICS: Enable drawing of bitmaps/tiles with just one sub-image
Instead of using the number of sub-images to decide whether bitmaps
should be drawn using TIL information, better use the existance
of texture coordinates which are distinctive for tiles.
2015-05-05 23:19:16 +02:00
Christian Krause a8460f4f3f EMI: Check bit in mesh face flags to disable lighting
Use bit 0x20 in the mesh face flags to disable ligthing. This
fixes the problem that once a previous screen is used as
texture (e.g. in the intro or for the transition effects
in set kab when walking eastwards or westwards), it is shown
too dark due to the applied static lighting for overworld
actors.
2015-02-24 22:49:48 +01:00
Christian Krause 6d226501b5 EMI: Implement mesh-specific alpha values
- if Lua_V2::SetActorGlobalAlpha() is called with a mesh name,
  set a mesh-specific alpha value / mode
- use this alpha value in drawEMIModelFace()
- fixes the problem that the whole actor vanishes in some scenes
  (e.g. when entering or leaving the porch of the of LUA bar)
2015-02-17 01:57:07 +01:00
Christian Krause 789da551fc GRIM/EMI: Add nullptr checks to avoid segfaults on cleanup 2015-01-13 21:12:23 +01:00
Christian Krause ad2ce4a87e EMI: Fix memleaks caused by specialtyTextures
- delete screenshot after texture is created
- free _data[] entries in BitmapData::freeData()
- destroy _specialtyTextures[] entries in
  graphic driver's destructors
2014-12-31 15:47:36 +01:00
Pawel Kolodziejski a37e7bc204 GRIM: fixed TinyGL draw sprites 2014-12-28 17:11:13 +01:00
Pawel Kolodziejski 2a6f23839f GRIM: turn on back Depth Write after draw shadow planes 2014-12-28 16:51:06 +01:00
Joel Teichroeb 2c44b2bbdc GRIM: Use floating point division 2014-11-29 16:01:40 -08:00
Christian Krause 1c43404192 GRAPHICS: Reset GL's current color in drawDimPlane()
Per convention, in residualvm the default GL current color
should be (1.0f, 1.0f, 1.0f). If a function changes the color,
it is required to reset it before returning.

This fixes the issue that some videos were not correctly displayed
until the next glColor call (e.g. when drawing the sub-titles) was
issued.
2014-11-05 20:59:56 +01:00
Christian Krause 11fee3d1d4 EMI: Enable alpha blending for global alpha values of actors
This fixes the problem, that all actors with a global alpha
value < 1.0f were not drawn with the correct transparency.
2014-09-17 20:59:50 +02:00
Christian Krause d6ed076e5a EMI: Use half-transparent plane to implement dimScreen (TinyGL)
- instead of re-calculating the color values when dimming the screen,
  better draw a half-transparent plane after drawing all non-overworld
  characters
- fixes the issue that overworld actors were dimmed and that the
  pause screen is transparent when the inventory is open
2014-09-13 10:49:21 +02:00
Paweł Kołodziejski 639076bc12 Merge pull request #974 from JoseJX/BigEndian
EMI: Big endian fixes
2014-09-09 17:56:03 +02:00
Christian Krause e2eee80716 EMI: Implement Lua_V2::SetActorLocalAlpha
- sets the alpha mode and the alpha value for single vertices
2014-09-08 09:00:21 +02:00
Joseph Jezak f3200a76ff EMI: Fix font text centering by using just the kerned width. 2014-08-20 09:36:31 -04:00
Joel Teichroeb 6a852161c7 Merge pull request #999 from JoseJX/Camera
EMI: Keep camera as a rotation matrix and add Lua functions for changing it.
2014-08-19 17:21:43 -07:00
Joel Teichroeb 32364faacf EMI: Fix the background color when running the debugger
Fixes #982
2014-08-19 17:11:34 -07:00
Joseph Jezak ff9f26981c EMI: Refactor to use a matrix for the camera. 2014-08-19 18:35:26 -04:00
Paweł Kołodziejski 0bd0bf6ca4 Merge pull request #1041 from Akz-/grim-sprite-fix
GRIM: Enable alpha test when drawing sprites.
2014-08-18 22:02:28 +02:00
Joni Vähämäki f15ae46912 GRIM: Fix the color key value in TinyGL. 2014-08-18 21:58:34 +03:00
Joni Vähämäki 915e12321c GRIM: Enable alpha test when drawing sprites. 2014-08-18 13:09:42 +03:00
Stefano Musumeci 23385b3a4a TINYGL: Fixed compiler warnings. 2014-08-16 16:04:20 +02:00
Stefano Musumeci 957fa20c30 GRIM: Replaced magic value with constant. 2014-08-16 16:04:00 +02:00
Stefano Musumeci 2cf70d6d76 Merge branch 'master' into tinygl-dirty-rects-fixed
Conflicts:
	graphics/tinygl/ztriangle.cpp
2014-08-16 16:03:27 +02:00
Paweł Kołodziejski 1eebd1139f Merge pull request #1024 from JoseJX/FixTinyGLFont
EMI: Fix font rendering with TinyGL.
2014-08-15 16:28:28 +02:00
Joseph Jezak 4a02e3af42 EMI: Fix font rendering with TinyGL. 2014-08-15 10:06:08 -04:00
Pawel Kolodziejski e539b27af8 MATH: improve type support for viewport argument 2014-08-15 12:25:48 +02:00
Christian Krause cbbf60d155 EMI: Check another bit in the mesh face flags to enable blending.
Bit 0x40000 in the mesh face flags (set only in the intro) should
enable blending, too. This fix lets the various screens of the intro
fade into each other.
2014-08-14 03:01:12 +02:00
Stefano Musumeci 8969247730 TINYGL: Fixed minor style issues. 2014-08-13 21:00:18 +02:00
Stefano Musumeci d0ce4482f9 GRIM: Changed the way strings are rendered. 2014-08-13 15:39:03 +02:00
Stefano Musumeci 8abb5b008c Merge branch 'master' into tinygl-dirty-rects
Conflicts:
	graphics/tinygl/zbuffer.cpp
	graphics/tinygl/zbuffer.h
2014-08-13 14:06:34 +02:00
Joni Vähämäki 3df07c384e EMI: Fix parsing of sprite flags. Fixes #960 2014-08-12 17:46:47 +03:00
Joni Vähämäki 6b7b6fa6e5 EMI: Do not disable writing to color buffer if an actor's sort order is >= 100.
Fixes invisible Guybrush in the set unc.
2014-08-12 17:46:46 +03:00
Joni Vähämäki 398f2afa98 EMI: Always write sprites to the depth buffer. 2014-08-12 17:46:45 +03:00
Joni Vähämäki ee24b2c12f EMI: Parse sprite Z offset. 2014-08-12 17:46:44 +03:00
Joni Vähämäki 055f742ccc EMI: Enable alpha blending if the mesh face flags has the 16th bit set.
This fixes drawing of the shadow mesh in the set unc when Guybrush is under the lights.
2014-08-12 17:46:43 +03:00