Commit Graph
47 Commits
Author SHA1 Message Date
Taylor Richards 39434fe7b1 fix a bunch of graphics functions to respect GR_STUB 2022-05-27 12:49:49 -04:00
Goober5000 636b4e81df Merge pull request #3960 from Goober5000/scripted_decals
add scripting support for decals
2022-04-02 13:57:40 -04:00
Goober5000 bd1cf2d07d prevent decals from being used on invalid objects 2022-03-13 21:55:44 -04:00
Goober5000 18a8e280dc add scripting support for decals
This extends the existing decal system so that decals can be created through scripting.
2022-03-01 19:07:39 -05:00
asarium ac77a6eb77 Fix render orientation for decals
The orientation was broken since the engine rendered the decal box in
the direction of the hit normal which meant that the viewer was looking
at a flipped version of the decal texture.

This fixes that by flipping the direction of the decal before passing it
to the GPU.

This also fixes the orientation for weapon decals which previously did
not take the orientation of the weapon that just impacted into account.
2022-03-01 19:14:34 +01:00
Goober5000 e2f63a2340 rename and document several model coordinate functions 2022-02-15 20:59:24 -05:00
Goober5000 88c1d8a02a consolidate model instance code 2020-12-18 01:32:43 -05:00
asarium 016c07dc3a Add feature to execute Lua coroutines at specific points
This adds a mechanism for running generic operations at specific points
of the frame execution. This can be used by any part of the code an not
just Lua since it simply executes std::functions. It also adds an
"execution context" concept that specifies in which situation an
operation should be executed.

This is then used by the Lua Coroutines code for resuming coroutines at
specific points instead of always when the awaited promise resolves.
2020-06-06 21:29:48 +02:00
asarium a3651026b1 Improve how the engine handles uniform buffers
This is in preparation for using persistently mapped buffers for uniform
buffers. Since that functionality is not available in the OpenGL version
we are targetting I implemented a fall-back which simply uses
glBufferSubData.

I did a benchmark with these changes and there was no change in
performance to the current master version.
2020-01-12 11:59:23 +01:00
asarium e790cf209a Add additional validity check for decals
This tracks the original object type of a decal and marks a decal as
invalid if the type changes. This should fix a bug reported by Spoon.
2018-11-18 12:41:55 +01:00
asarium 513115ceeb Enable misc-noexcept-move-constructor check 2018-04-13 12:10:24 +02:00
asarium 1ace8b3abc Reenable decals in nebulas
With the recent changes to how fog is handled in nebulas it is now
possible to render decals correctly in a nebula environment so there is
no need to disable decals when the mission is in a nebula.
2018-03-06 11:38:07 +01:00
asarium 520e532c56 Add normal map rendering to decals
This changes the decal system so that it is able to modify the normal
map of the scene. I tested this with some existing normal maps but I am
not entirely sure if the tangent matrix I construct uses the right
values so some additional testing with normal maps made specifically for
decals would be good.

This also fixed the issues introduced by the changes to how directional
lighting was handled. Now a decal can have a diffuse and a glow map. The
diffuse map is used to change the values of the color buffer and also
supports ambient lighting. The glow map renders into the emissive buffer
and should be used for effects that should not receive lighting.
2018-03-06 11:38:01 +01:00
asarium 99f69c903e Add screen space decal rendering system
This allows to render screen space decals into the deferred lighting
buffers no matter how complex the underlying geometry is.

Currently there is only limited support for using this in the engine.
Only weapon impact decals are supported at the moment for testing
purposes.
2018-01-12 17:09:49 +01:00
Zacam b9b5237123 Purging of the Decal system. Includes Projects updates for codeblocks, MSVC 6-2010 and Xcode. 2010-09-30 05:50:04 +00:00
taylor b813983b32 put decals back under an #ifdef, until this is fixed it's just in the way 2006-06-01 04:41:43 +00:00
Goober5000 b52b6b1e00 spelling 2006-02-25 21:47:19 +00:00
taylor 6f18a905e0 more TMAP_MAX_VERTS overflow protection for non-HTL usage (these are the things that need to be addressed to fix non-HTL)
fix some compiler warning messages
don't do any decal processing if decals are disabled, the math was a waste of CPU cycles in that case
2005-10-28 14:45:55 +00:00
Goober5000 12c90e780d remove PreProcDefine #includes in FS2
--Goober5000
2005-07-13 02:50:53 +00:00
Goober5000 41a06a3ac9 removed DECALS_ENABLED
--Goober5000
2005-07-12 22:14:40 +00:00
taylor d3d8a5f15d check_values() shouldn't be inline anymore
remove useless neb2_get_fog_intensity() call
s/alocate/allocate/g
2005-06-19 09:03:05 +00:00
taylor 2b430d943d use vm_malloc(), vm_free(), vm_realloc(), vm_strdup() rather than system named macros
fixes various problems and is past time to make the switch
change system->decals allocation to use real vm_realloc() rather than that manual method
2005-05-12 17:39:13 +00:00
taylor 7e3b7769c6 many, many compiler warning and header fixes (Jens Granseuer)
fix free on possible NULL in modelinterp.cpp (Jens Granseuer)
2005-04-12 05:26:38 +00:00
taylor 7f786136a6 s/vector/vec3d/g, better support for different compilers (Jens Granseuer) 2005-04-05 05:53:25 +00:00
bobboau e0907340c1 added a geometry batcher and implemented it in sevral places
namely: lasers, thrusters, and particles,
these have been the primary botle necks for some time,
and this seems to have smoothed them out quite a bit.
2005-03-16 01:35:59 +00:00
Goober5000 5548a8e954 edited for language ;)
--Goober5000
2005-03-08 03:50:25 +00:00
bobboau 9c9876909b oh, hey look I've commited something :D
animation system, weapon models detail box alt-tab bug, probly other stuff
2005-03-01 06:55:45 +00:00
taylor 0bf7ee01dc merge with Linux/OSX tree - p0131-2 2005-01-31 23:27:55 +00:00
Goober5000 be761d4fc1 nitpicked some boolean tests, and fixed two small bugs
--Goober5000
2005-01-30 09:27:41 +00:00
Goober5000 a746194c10 cleaned up some build warnings
--Goober5000
2005-01-28 11:39:18 +00:00
Goober5000 603b466d84 small speedup in shpere_tri_edge (spelling should be fixed...); now distance is only calculated once
--Goober5000
2005-01-06 00:22:01 +00:00
taylor 2f8a2dc863 fix logic error, may be support ship rearm fix 2004-09-26 20:58:29 +00:00
Goober5000 341d7b09e7 whoops, fixed this for debug mode
--Goober5000
2004-09-05 19:41:31 +00:00
Goober5000 3766a10e38 fixed a few warnings
--Goober5000
2004-09-05 19:23:24 +00:00
Kazan 7d1c8b185d added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this 2004-08-11 05:06:36 +00:00
Kazan 864e1b5922 remove MCD complete 2004-07-26 20:47:56 +00:00
wmcoolmon a842f88067 Fixed ifdef, was missing ship_decal_system otherwise 2004-07-20 04:03:21 +00:00
Kazan 428b3dcbc9 MCD - define _MCD_CHECK to use memory tracking 2004-07-12 16:33:09 +00:00
bobboau a3422b4d01 added the working decal code 2004-07-11 03:22:54 +00:00
Goober5000 7ef2ab2e39 Uber pass at reducing #includes
--Goober5000
2004-03-05 09:02:13 +00:00
randomtiger 6155d89c49 Small changes, deleted old dshow stuff 2004-02-05 01:41:33 +00:00
phreak 3dccd906b0 commented out file pending rewrite 2004-01-31 03:52:41 +00:00
bobboau 8a1be5efb8 forgot something 2003-03-03 16:50:14 +00:00
penguin 48b19f764c ANSI C++ changes
- penguin
2003-03-02 05:07:12 +00:00
bobboau 67faca1076 added several sExps for turning glow points and glow maps on and off 2003-01-20 05:40:50 +00:00
bobboau 12f8b745d2 disabled decals (for now), removed the warp ray thingys,
made some better error mesages while parseing weapons and ships tbls,
and... oh ya, added glow mapping
2003-01-05 23:41:51 +00:00
DTP bb55e367ef DTP; added decals.h and decals.cpp to the project, aswell as the directory 2002-12-10 00:44:38 +00:00