Commit graph

152 commits

Author SHA1 Message Date
Jakub
a668d49331
Implemented fog bulb (#1110)
* Added fog bulbs

* WIP raymarch

* constant fog formula with simplex noise

* Improved fog formula and handling

* Raymarch less expansive;
Added fog bulbs to sprites;
Removed premultiplication of fog density by color at load time;

* Avoid raymarch if fog > 1

* Sorting fog bulbs front to back;
Performance improvements;

* Added frustum culling for fog bulbs

* Tryiing without raymarch

* Refactored fog code;
Added noise and wibble to fog;
Fixed sprites;

* Disabled wibble for fog

* Removed noise

* Fof bulbs like TR5

* Fixed Pascal Case in RenderView;
Fixed formatting things;
Fixed sprites;

* Optimizations

* Fixed sprites in fog bulbs

* Fixed project paths

* Fix compiler warning

* Fixed repository

* Fog bulbs for sky and horizon

* Sky tessellation

* Update Renderer11Draw.cpp

---------

Co-authored-by: MontyTRC89 <montyhammet@hotmail.it>
Co-authored-by: Raildex <n@a.com>
Co-authored-by: Lwmte <3331699+Lwmte@users.noreply.github.com>
2023-05-31 09:12:20 +01:00
Lwmte
06182215d7
Resolve compiler warning 4554 (#1123)
* Resolve 4554
* Update TombEngine.vcxproj
* Update tomb4fx.cpp
* Fix warnings as errors flag for release build
* Introduce some fixes for W4 warnings
* Update object_helper.cpp
* Minor formatting
* Also solve 5051

---------

Co-authored-by: Sezz <sezzary@outlook.com>
2023-05-27 11:39:33 +02:00
Lwmte
e671f80fac Fix rope drawing again 2023-05-26 19:02:53 +02:00
Lwmte
4d63d92364
x64 version (#1113)
* Sort out compiler errors (excluding external libraries)

* Add TODO comment

* Use empty() method

* Fix wrong casts

* Fix new warnings

* Fix merge error

* Revert "Merge branch 'develop' into sezz_x64"

This reverts commit f695769189, reversing
changes made to 54c5e0c70d.

* Revert "Revert "Merge branch 'develop' into sezz_x64""

This reverts commit e1128c41f8.

* Update all libraries with x86 versions, organize lib directories, update x64 config

* Show app bitness in a log file

* Fix text rendering by uncommenting ToWString helper function

* Ship dlls and automatically replace them when switching between x86/x64

* Update TombEngine.vcxproj

* Adjust ammo struct; remove unneeded line

* Update broken x64 config for release mode

* Fix more project config inconsistencies

* Update TombEngine.vcxproj

* Remove unnecessary casts

* Tabs not spaces

* Update TombEngine.vcxproj.user

* Revert "Update TombEngine.vcxproj.user"

This reverts commit c168943ed0.

* Add x64 lua53.lib, remove DLLs.

---------

Co-authored-by: Sezz <sezzary@outlook.com>
Co-authored-by: Stranger1992 <84292688+Stranger1992@users.noreply.github.com>
Co-authored-by: hispidence <squidshirehimself@gmail.com>
2023-05-21 16:01:27 +01:00
Nemoel-Tomo
e4d4a61ed7
Fix tr5 laser barriers (#1093)
* finished lights

* Fix formatting

* Formatting

* Update itemdata.h

* test

* import light branch

* fixed error

* finished laser initialising

effects are missing

* hide nullmesh

* import Laser visuals fro richardtrle, import develop

* fix lasers. still a lot of work to do

* update

* Lasers use model color now

* Formatting

* Revert "Formatting"

This reverts commit cdf44035b0.

* Revert "Revert "Formatting""

This reverts commit 0e4e56709b.

* Fix global

* Names

* Simplify vertex position storage

* fixed lasers

* Update shaders

* bugfix

* Laser fade in, light distortion

* finished lasers, sound

* updating shaders for upper and lower fading

* Capitalize variable

* Update control.cpp

* Update control.cpp

* Rename laser barrier object ID

* Rename variables; use references; fix formatting

* Fix shader code formatting

* Update laser barriers

* Newline

* Remove unnecessary global, rename cbuffer field

* Add bool member variables; demagic numbers

* Edit comments

* -

* removed 3 latest commits from sezz bc laser was not working correctly anymore

laser should flicker if lLara collides. else it should slowly change between 0.8 and 1.0. collision was not working anymore, please do not change anything anymore :) :)

* calculate laser barrier vertex every loop

* Bring back reverted changes

* Use references as per conventions; make function static; rename function

* Rename file

* Remove deeply archaic TR5 garbage; maybe fix drift

* Organise

* Rotate barriers correctly; make variable names clearer

* Initialize barrier height only once; don't snap to floor upon init

* Update vertex generation; add methods

* Move bounding box update code

* Make beam counts adapt to ceiling height; use floats

* Small formatting fixes

* removed barrier.IsActive from renderer

* Remove global variable

---------

Co-authored-by: Sezz <sezzary@outlook.com>
Co-authored-by: Lwmte <3331699+Lwmte@users.noreply.github.com>
2023-05-18 16:26:55 +01:00
Kubsy
7f2baaf53f
Object init organize (#1090)
* start reorganize

* progress

* address some of @Lwmte suggestions

* Move setup.cpp to Game folder and capitalize it

* Include corrections

* include the new Setup.cpp in vcxproj

---------

Co-authored-by: Lwmte <3331699+Lwmte@users.noreply.github.com>
Co-authored-by: Sezz <sezzary@outlook.com>
2023-05-01 11:24:48 +01:00
Joey Quint
6d9c03ea36 Fix crash if ID_LITTLE_BEETLE exists and ID_BATS_EMITTER does not
Copy-paste error
2023-04-24 21:31:42 +02:00
Sezz
a4e07855d8 Rename new file according to conventions; slightly expand neck sphere for hair collision 2023-03-25 13:23:59 +11:00
Nemoel-Tomo
8fc38c6b4f
Tr3 boateffect (#1025)
* New rooms collector

* Fixed bugs in rooms collector;
Added caching of transformed portals vertices;

* Added more optimizations

* Fixed a bug in room collector;
Restored build configurations;

* Added static meshes caching;
Improved rooms collector;
Added statistics for rooms collector;

* Added ControlPhase time

* Corrected sme typos

* Moved scissor rectangle calculation away from draw routines

* Added cache invalidation

* test

* Normalize camera to door vector

* Added test code from OL;

* Excluded dot = 0 from doors processing; Increades stack overflow guard limit to 128; Removed test code;

* Optimized drawing of additive sprites

* Increased sprites instances count to 512 per bucket; Index UV array in shader by index instead of branching;

* Cleanded sprites shaders;
Optimized alpha blended sprites;

* Added Width and Height fields to Texture2D;
Restored underwater caustics;

* Restored bars drawing;

* Restored drawing of overlays

* Fixed fit code in DrawFullScreenSprite()

* Upgraded to DXTK 2019;
Implemented DDS loading;

* Upgraded DXTK to 2019

* Allow loading of both DDS and PNG textures

* Temporarly disabled shininess in inventory

* good progression

* Optimized alpha blended faces;
Fixed bug with floating statics alpha blended polygons;
Fixed gunshells when alpha blended faces are present on screen;
Restored debug stats also for release mode;

* update

* progression on the boat effect

* code cleaning

* formatting

* Fixed GPU states in alpha blend pass;

* added 3 useable streamers. left-right-center

* working code but without any formatting

* Some names refactoring;

* Renamed AddSprite3D to AddQuad;
Added overload to AddQuad for setting individual colors to each quad vertex;

* only test

* added waves to other vehicles

* add mist to speedboat and rubber boat

* WIP statics instancing

* Refactored constant buffers;
Restored gunflashes;
WIP dynamic lights for instanced statics;

* Polished instancing code

* Code fixes

* Changed grouping of instanced statics using std::map;
Improved instancing;

* Fixed lighting for instanced statics

* Draw gunshells with instancing

* Changed caustics frame index if out of range

* Removed not needed and repeated calculation of room's distance in rooms collector

* Avoid doing dot product if already was tested that door can't be seend by current camera position

* Removed old debug variables;
Added dot products count debug variable;
Avoid doing dot product if already done;

* Fixed normal mapping

* Fixed drawing of effects, moveables explosions and other things using the static FX;

* Instancing for scarabs and bats

* Fixed missing sorted sprites in overlapping rooms

* fixed merging issues, made branch playable

* Fixed sorted quads drawing (and now footprints work)

* Added white sprite;
Added AddColoredQuad() functions;

* pulled latest instancing branch

* included AddQuad from instancing branch

* Fixed missing sprites

* formatting

* update

* update

* merged develop to boat effect

* Organise includes

* Fix formatting

* Avoid using 5 different names for the same thing

* Avoid manual trigonometry

* Simplify use of enum class

* Prepare structs for later

* Outline streamer object methods

* Simplify

* Un-invert streamer array; use "for each" loops

* Store segments in dynamic container

* Remove unneeded function

* Simplify

* Store only 2 vertices per segment

* Progress

* Progress

* Allow for multiple instances of the same streamer

* Define constants; fix StreamerInstancer

* Update blend mode

* Simplify class structure

* Simplify

* Further restructuring

* Have smooth tail end when starting a streamer

* Pass life as value in seconds

* Update drawing

* Properly erase empty elements

* Clear up naming ambiguities

* Add assertions

* Simplify loops

* Simplify; clamp interpolation alpha value just in case

* Clear streamers during cleanup

* Simplify

* Optimise update methods

* Pass const references instead of copies of objects to quad rendering

* Simplify

* Update effect templates

* Slightly optimise sprite functions

* Add methods for streamer vertex handling

* FINALLY get AxisAngle working with streamers

* Simplify

* Update AxisAngle

* Allow streamers to rotate; simplify AxisAngle usage for helix

* Add TranslatePoint() overloads

* Progress

* Add converter method to AxisAngle

* Rename class; use flags

* Fix flags

* Use std::min

* Simplify

* Fix error

* Fix sprite blending

* Prepare vehicle wake function

* Create SpawnVehicleWake() and adopt for speedboat

* Remove commented code

* Add comment

* Update wake function

* Backtrack

* Adopt streamer function for kayak

* Update vehicle wakes

* Roughly update wake offsets

* Simplify

* Add comment; fix condition

* Update VehicleHelpers.cpp

* Update VehicleHelpers.cpp

* Adjust wake function and adopt for UPV

* Remove old streamer implementation

* Remove "this->" on member variables

* Update parameters

* Cleanup

* Update savegame

* Add failsafe

* Fix streamer opacity handling

* Update VehicleHelpers.cpp

* Rename parameters

* Make streamers fade in faster

* Adjust minecart wake offset

* Remove debug Bit.Trip rainbow

* Simplify

* rised the wakes on water level a nit for opaque textures

* Always align wakes with water surface height; demagic values

* Adjust wake function

* Use TEN assertion()

* rised the streamers a bit so that it also works on opaque textures

* adjusted speedboat wake offsets

* Fix wakes clamping on water surface

* add missing semi-colon

---------

Co-authored-by: MontyTRC89 <montyhammet@hotmail.it>
Co-authored-by: Lwmte <3331699+Lwmte@users.noreply.github.com>
Co-authored-by: Kubsy <kubadd475@gmail.com>
Co-authored-by: Sezz <sezzary@outlook.com>
2023-03-19 09:17:43 +00:00
Sezz
13309ee288
HUD revisions tier 2 (#1016)
* Create classes for status bars

* Formatting

* Remove unnecessary lines

* Add air status bar

* Simplify health bar logic

* Add sprint status bar

* Add comments

* Rename constant

* Add comments

* Simplify draw logic; adjust bar life

* Exclude torch

* Rename constant

* Prepare opacity functionality for status bars

* Simplify colour values

* Organise bar rendering code; remove unused constant

* Demagic several values

* Add constant

* Encapsulate constants inside classes; update bar display life

* Pass reference to renderer HUD bar

* Update StatusBars.cpp

* Rename parameter

* Update StatusBars.cpp

* Encapsulation

* Tabs

* Remove unnecessary parameters

* Refine health bar behaviour

* Reduce copypase

* Don't show air bar when wading in water

* Don't show air bar while treading water

* Only show air bar when necessary

* Refine check

* Don't flash sprint bar

* Initialise bars properly on level load

* Avoid depleting air bar when dead

* Remove unnecessary includes; rename local variables and constants

* Rename

* Rename function

* Update StatusBars.h

* Add GetLaraInfo() overloads

* Remove else

* Update comment

* Remove include

* Adjust bar positions
2023-03-08 15:20:04 +00:00
Lwmte
9f5e5976fb Fix missing caustics regression 2023-02-25 21:51:33 +02:00
Sezz
2b187e8757
Update drips, ripples, bubbles (#998)
* Update drips and ripples

* Make splash bubbles way cooler

* Remove LaraNodeUnderwater global; simplify wetness drip spawning

* Simplify node effects

* Add bubble spawned function for dives

* Fix dive bubble spawning

* Ripple fade wip

* Update ripples

* Remove extern

* Rename local variables

* Simplify ripples; convert enum to enum class

* Rename enum entry

* Simplify ripples

* Use "size" instead of "scale"

* Adjust ripple value

* Reorder bubble calculations

* Fix drip crash

* Reduce number of bubbles spawned

* Temporarily restore high bubble count

* Refactor node effect functions

* Maybe improve bubble lag; move player bubble handler function

* Reduce Bubble struct size

* Switch to std::vector for effects

* Also use std::vector as container for display pickups

* Revert "Also use std::vector as container for display pickups"

This reverts commit 539a7d77dd.

* Update effects.h

* Update lara_helpers.cpp

* Fix bubbles getting stuck on walls
2023-02-25 14:51:45 +00:00
Kubsy
0c9703ce30
Instancing - further renderer fixes (#984)
* New rooms collector

* Fixed bugs in rooms collector;
Added caching of transformed portals vertices;

* Added more optimizations

* Fixed a bug in room collector;
Restored build configurations;

* Added static meshes caching;
Improved rooms collector;
Added statistics for rooms collector;

* Added ControlPhase time

* Corrected sme typos

* Moved scissor rectangle calculation away from draw routines

* Added cache invalidation

* Normalize camera to door vector

* Added test code from OL;

* Excluded dot = 0 from doors processing; Increades stack overflow guard limit to 128; Removed test code;

* Optimized drawing of additive sprites

* Increased sprites instances count to 512 per bucket; Index UV array in shader by index instead of branching;

* Cleanded sprites shaders;
Optimized alpha blended sprites;

* Added Width and Height fields to Texture2D;
Restored underwater caustics;

* Restored bars drawing;

* Restored drawing of overlays

* Fixed fit code in DrawFullScreenSprite()

* Upgraded to DXTK 2019;
Implemented DDS loading;

* Upgraded DXTK to 2019

* Allow loading of both DDS and PNG textures

* Temporarly disabled shininess in inventory

* Optimized alpha blended faces;
Fixed bug with floating statics alpha blended polygons;
Fixed gunshells when alpha blended faces are present on screen;
Restored debug stats also for release mode;

* Fixed GPU states in alpha blend pass;

* Some names refactoring;

* Renamed AddSprite3D to AddQuad;
Added overload to AddQuad for setting individual colors to each quad vertex;

* WIP statics instancing

* Refactored constant buffers;
Restored gunflashes;
WIP dynamic lights for instanced statics;

* Polished instancing code

* Code fixes

* Changed grouping of instanced statics using std::map;
Improved instancing;

* Fixed lighting for instanced statics

* Draw gunshells with instancing

* Changed caustics frame index if out of range

* Removed not needed and repeated calculation of room's distance in rooms collector

* Avoid doing dot product if already was tested that door can't be seend by current camera position

* Removed old debug variables;
Added dot products count debug variable;
Avoid doing dot product if already done;

* Fixed normal mapping

* Fixed drawing of effects, moveables explosions and other things using the static FX;

* Instancing for scarabs and bats

* Fixed missing sorted sprites in overlapping rooms

* Fixed sorted quads drawing (and now footprints work)

* Added white sprite;
Added AddColoredQuad() functions;

* Fixed missing sprites

---------

Co-authored-by: MontyTRC89 <montyhammet@hotmail.it>
Co-authored-by: Lwmte <3331699+Lwmte@users.noreply.github.com>
2023-02-25 10:20:21 +00:00
Sezz
67518589a7
HUD revisions (#990)
* Pickup summary and HUD revisions

* Remove unnecessary includes

* Add necessary bool

* Store screen resolution as Vector2i

* Organise

* Update string rendering to take a scale factor

* Add newline

* Add parentheses

* Prepare count string scaling functionality; reorder parameters

* Move conversion

* Add std::string to std::wstring converter function

* Make string converter function names more reflective of what they do

* Rename parameter

* Remove unnecessary utility function

* Pulse count string when incrementing display pickup count

* Adjust string count appearance

* Rename constant

* Add pickups to inventory

* Refine logic

* Update PickupSummary.cpp

* Fix display pickup positioning in all resolutions

* Redefine constants

* Update comment

* Simplify

* Update position and scaling

* Make const static

* Fix logo placement

* Restore scale

* Make simple EulerAngles constructors constexpr

* Reorder conditions

* Update comment

* Use constant

* Use "this->" for security

* Formatting

* Shorten member variable name

* Move comment

* Use "this->" for security

* Update PickupSummary.cpp

* Use correct alpha value for string scalar

* Handle invalid screen space positions

* Add TODO comment

* Fix compile error; add constant; restore camera swivel during pickup animation

* Correctly display pickups picked up offscreen

* Update Renderer11Draw2D.cpp

* Remove unnecessary include and forward decl
2023-02-12 12:29:14 +00:00
Lwmte
126e2a409b
Draw holsters for shadow and bypass skin / braid / joints if they don't exist (#977)
* Draw Lara holsters in shadow, don't crash if level has no braid or joints
* Update Changes.txt
* Also make lara skin object optional
* Update Renderer11Compatibility.cpp
* Update Renderer11Helper.cpp
* Update Renderer11Helper.cpp
* Update Changes.txt
2023-01-31 02:01:18 +02:00
Lwmte
84b9a2d0d5 Fix silent crash in case caustics were not found 2023-01-28 18:24:45 +02:00
Sezz
7953bd8f13 Rename everything 2023-01-29 00:03:55 +11:00
Nemoel-Tomo
77034b622a Merge branch 'master' into fix-TR5-Twogun 2023-01-25 16:05:36 +01:00
Anatoly
45693e2c05
Add fixed shadow and dropped pickup positions (#955)
* Add fixed shadow and dropped pickup positions
* Update TranslatePoint() overloads
* Rename parameters
* Alphabetise includes
* Also rename to "relOffset" in another function
* Rewrite pickup drop method
* Added step test for candidate pickup drop positions
* Randomize startup point, don't use first joint position for shadow as it isn't correct sometimes
* Do more thorough step tests for pickups
* Fix rotation
* Simplify step tests again
* Update pickup.cpp

Co-authored-by: Sezz <sezzary@outlook.com>
2023-01-22 22:26:18 +02:00
Sezz
72b056809e Rename things for consistency 2023-01-15 23:44:38 +11:00
Sezz
b174098c3b Merge branch 'master' into fix-TR5-Twogun 2023-01-14 13:14:13 +11:00
Lwmte
827b8d05f0 Fix #880 2023-01-13 02:28:03 +02:00
Sezz
00b865489d Naming 2023-01-12 22:20:57 +11:00
Nemoel-Tomo
e86a887e63 include latest master branch into my twogun fix 2023-01-12 10:25:51 +01:00
Kubsy
7f72cdae3b
Rooms collector fixes (#898)
* New rooms collector

* Fixed bugs in rooms collector;
Added caching of transformed portals vertices;

* Added more optimizations

* Fixed a bug in room collector;
Restored build configurations;

* Added static meshes caching;
Improved rooms collector;
Added statistics for rooms collector;

* Added ControlPhase time

* Corrected sme typos

* Moved scissor rectangle calculation away from draw routines

* Added cache invalidation

Co-authored-by: MontyTRC89 <montyhammet@hotmail.it>
Co-authored-by: Lwmte <3331699+Lwmte@users.noreply.github.com>
2023-01-11 02:11:27 +02:00
Nemoel-Tomo
c45f114c89 setting everything up for draw twogunlaser 2023-01-01 14:50:46 +01:00
Nemoel-Tomo
a263f7a538 removed DrawDarts remnant in Renderer11.h and Renderer11Draw.cpp 2022-12-19 19:32:59 +01:00
Nemoel-Tomo
e225ddec87 changed darts to draw real mesh 2022-12-19 18:43:07 +01:00
Nemoel-Tomo
36a8828b4e fixed errors and dart emitter 2022-12-19 14:57:08 +01:00
Nemoel-Tomo
7a197a3c6e tr3-tribesman-fix 2022-12-19 10:48:34 +01:00
Lwmte
259918e51c Highlight active volumes, cleanup debug output 2022-12-14 16:06:22 +02:00
Lwmte
035491b381 Organize debug drawing properly 2022-12-12 00:46:16 +02:00
Lwmte
c170596617 Unify DoTitle and DoLevel 2022-12-06 20:08:21 +02:00
Anatoly
6129ac9feb
FOV fixes (#878)
* Fix #535, #745, #831, save FOV in savegame
* Update Changes.txt
2022-11-29 16:27:07 +02:00
Lwmte
2c6d827832 Fix caustics not turning off in display settings 2022-11-26 17:32:42 +02:00
Anatoly
827416f887
Meshswap refactor (#828)
* Work
* Fix TestMeshSwapFlags
* Rename callbacks
* Revert unrelated changes
* Update items.h
2022-11-11 14:47:20 +02:00
MontyTRC89
926725d162 Merge branch 'master' into renderer_fixes
# Conflicts:
#	TombEngine/Renderer/Renderer11.h
#	TombEngine/Renderer/Renderer11Enums.h
#	TombEngine/Renderer/Renderer11Init.cpp
#	TombEngine/Renderer/RendererVertex.h
#	TombEngine/Shaders/DX11_Sprites.fx
#	TombEngine/TombEngine.vcxproj
2022-11-02 15:34:04 +01:00
Lwmte
4b95588984
Merge pull request #759 from MontyTRC89/very_experimental_input_stuff
Input actions, GUI cleanup
2022-11-02 13:44:41 +02:00
Lwmte
f47bb02b3b Merge branch 'master' into renderer_fixes 2022-11-02 12:07:55 +02:00
Lwmte
1189371b7b Set blending mode to constant buffer 2022-11-02 11:30:12 +02:00
Sezz
8d9852f6ce Merge branch 'master' into very_experimental_input_stuff 2022-11-01 23:01:38 +11:00
Lwmte
9e64e04f5e Update Renderer11Draw.cpp 2022-11-01 01:04:42 +02:00
Lwmte
de11d485c9 Merge branch 'master' into renderer_fixes 2022-10-27 14:53:51 +02:00
Sezz
27bb5f0b35 Merge branch 'master' into very_experimental_input_stuff 2022-10-25 20:11:58 +11:00
Sezz
40503f8521 Merge branch 'master' into very_experimental_input_stuff 2022-10-24 15:21:36 +11:00
Sezz
75b36d8f0f Merge branch 'master' into math 2022-10-24 15:17:46 +11:00
Sezz
30ea899ee7
Bit field class (#736)
* Prototype BitField class

* Use vector<bool> instead

* Rename; add Fill() private method; organise

* Fix comments

* Fix off by 1 errors

* Fix more off by 1 errors

* Resize in constructor

* Use const parameters where necessary

* Tentatively add typedefs to framework.h

* Don't make copies of vectors

* Rename

* Update BitField class

* Update BitField class

* Update BitField operator

* Add TestAny() method

* Update BitField class

* Add |= and & operators for compatibility

* Add return value

* Add comment

* Rename; make method const

* Update framework.h

* Remove duplicate method

* Optimise

* Optimise; add operators

* Add converter methods

* Update BitField class

* Add GetCount() method

* Adopt BitField class usage

* Fix BitField errors

* Fix wrong type in loops

* Make BitField methods and operators const where possible

* Fix ToString() method

* Fix BitSet comparison operators

* Simplify

* Set default

* Set defaults

* Add warnings to BitField

* Reformat local variable

* Add warning

* Add comments

* Remove TestNone()
2022-10-24 14:15:42 +11:00
Sezz
bf9e3561ab Reformat a file name 2022-10-22 19:55:18 +11:00
Sezz
42d1f1cd6b Rename BOUNDING_BOX to GameBoundingBox 2022-10-14 12:16:55 +11:00
Sezz
ba7c8fa15c Add constructors to BOUNDING_BOX; absorb GetBoundsAccurate(); remove InterpolateBounds global 2022-10-08 20:48:46 +11:00