Commit graph

39 commits

Author SHA1 Message Date
ManIsCat2
6524e709a3
Fresnel Lighting from F3DEX3 (#941)
Some checks are pending
Build coop / build-linux (push) Waiting to run
Build coop / build-steamos (push) Waiting to run
Build coop / build-windows-opengl (push) Waiting to run
Build coop / build-windows-directx (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
* Fresnel part1

* Fresnel part2

* vmacu
2025-09-13 12:40:38 +02:00
ManIsCat2
5f1a2d0b42
Gfx commands to Copy Lights into Env/Prim color (#927)
Some checks are pending
Build coop / build-linux (push) Waiting to run
Build coop / build-steamos (push) Waiting to run
Build coop / build-windows-opengl (push) Waiting to run
Build coop / build-windows-directx (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
2025-08-28 06:27:25 +10:00
djoslin0
82ca45eeb6
Lighting engine improvements (#870)
* Lighting engine improvements

Now objects will be affected by the lighting engine. This is
accomplished by passing the renderer the object's model matrix
(uncombined with the view or projection). You can now setup the
lighting engine mode to affect all shaded surfaces, lighting can
be affected by surface normals, and you can control what type of
tone mapping is applied.

added le_set_mode(mode)
    By default we retain the previous behavior.

    When set to LE_MODE_AFFECT_ALL_SHADED the lighting engine will
    affect every shaded material.

    This way we don't have to recompile every object and level that
    we want shaded with special coop-specific commands

added le_get_mode()

added le_set_tone_mapping(toneMapping)
    Tone mapping is what happens when a color value exceeds its 0-255
    range.

    By default we retain the current tone mapping (called
    LE_TONE_MAPPING_TOTAL_WEIGHTED).

    LE_TONE_MAPPING_WEIGHTED is now accessible, it was the tone
    mapping that was previously left out of the compile through ifdefs.

    LE_TONE_MAPPING_CLAMP is just simple additive with a clamp at a
    color value of 255.

    LE_TONE_MAPPING_REINHARD is reinhard tone mapping
    (vout = (vin + 1) / vin).

added le_set_light_use_surface_normals(id, useSurfaceNormals)
    By default lights retain their previous behavior (of ignoring
    surface normals).

    When enabled lights cast on one side of the object will not
    appear on the other side of the object.

    It is kind of like backface culling, but for lights.

added le_calculate_lighting_color_with_normal(pos, normal, outColor, lightIntensityScalar)
    It's just like le_calculate_lighting_color(), but you can pass
    in normals now.

* Removed normal calculation from vertex colored surfaces - they don't have normals

* Use packed normals correctly

* made LE_MODE_AFFECT_ALL_SHADED the default

* made useSurfaceNormals the default for lights

* Set ambient color, performed le_is_enabled() checks

The ambient color was black, which is why everything was dark by default.
If we set ambient to white then people will never see the effects of their
lights unless they set ambient to a lower value. So I added checks for
if a light has ever been added. The alternative would be to have something
like le_set_enabled()

* Rewrite how we obtain the model matrix - invert the camera

* run autogen

* Change default tonemapper to weighted, make setting ambient enable LE, fix null deref

* Address Peachy's comments

---------

Co-authored-by: MysterD <myster@d>
2025-06-29 17:46:35 +02:00
ManIsCat2
29f9e7cfcb
Add G_PACKED_NORMALS Geo Mode from F3DEX3 (#768)
Some checks are pending
Build coop / build-ubuntu (push) Waiting to run
Build coop / build-windows (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
* Add new geometry mode

* Fix lua vertex colors not working
2025-04-25 15:07:31 -04:00
PeachyPeach
467b22e939
Gfx set command: v2 + Gfx/Vtx dynamic alloc (#718)
Some checks failed
Build coop / build-ubuntu (push) Has been cancelled
Build coop / build-windows (push) Has been cancelled
Build coop / build-macos-arm (push) Has been cancelled
Build coop / build-macos-intel (push) Has been cancelled
* set_gfx_command part 2

* part 3

* get gfx/vtx from name; copy gfx/vtx

* gfx/vtx dynamic allocation lua

* gfx/vtx_new: don't take level/model/vanilla names

* Clean up gbi constants

* update example

* Isaac review; add gfx_get_next_command and vtx_get_next_vertex

* make all commands length 1; missing NULL checks
2025-04-12 18:19:14 -04:00
Agent X
3e540790a3
Basic Vertex Point Lighting Engine (#716)
* CONCEPT: Basic vertex lighting engine

Set the geometry mode on your model to G_LIGHTING_ENGINE_EXT, spawn a `bhvAmbientLight`, spawn some `bhvPointLight`s, and then you got yourself a mighty interesting scene.

* Fixes

* How did I miss this

* Make light set home pos
2025-03-27 16:36:02 -04:00
Isaac0-dev
f238b3d0f5
allow Lua to manipulate displaylists and vertices (#675)
Co-authored-by: ManIsCat2 <137772623+ManIsCat2@users.noreply.github.com>
2025-02-27 14:27:55 +10:00
Agent X
49bca1cc01 sm64coopdx
Co-Authored-By: Yuyake <140215214+AngelicMiracles@users.noreply.github.com>
Co-Authored-By: FluffaMario <50761036+FluffaMario@users.noreply.github.com>
Co-Authored-By: Gregory Heskett <gheskett@gmail.com>
Co-Authored-By: iZePlayzYT <69536095+iZePlayzYT@users.noreply.github.com>
Co-Authored-By: Isaac0-dev <62234577+Isaac0-dev@users.noreply.github.com>
Co-Authored-By: eros71 <16540103+eros71-dev@users.noreply.github.com>
2023-10-30 01:03:36 -04:00
MysterD
41a4fcf516 Keep animations in-bounds 2023-05-18 12:42:18 -07:00
MysterD
e9ecf7a8f4 Made light maps a little less hacky 2023-04-28 00:22:30 -07:00
PeachyPeach
6449b7d578
Complete color palettes; gfx macros (#191) 2022-09-18 17:30:13 -07:00
Prince Frizzy
f51f1d6c4a
Merge in small changes. (#63) 2022-04-16 19:12:12 -07:00
Prince Frizzy
75bb9b7912
Update to Refresh 13 (#19)
* Refresh 13

Co-authored-by: n64 <n64>
2022-03-13 00:17:10 -08:00
PeachyPeach
0c42836b81
Added support for X and Y buttons; Re-mapped B button to the actual B button for controllers; Moved particleFlags code so lua scripts can spawn Mario particles with 'before Mario update' and 'after Mario update' hooks (#5) 2022-02-27 14:31:59 -08:00
MysterD
038c1135b3 Initial DJUI commit
The birth of a custom user interface system.

Has the ability to draw things to the screen at native resolution
regardless of window size.

Components can be nested within one another to an arbitrary depth.

Text rendering is completely rewritten.

Text and images can be clipped by their parent container.
2021-06-18 15:23:59 -07:00
fgsfds
798389b527 added new GBI command: G_COPYMEM
exclusively for copying lights around for now; required for my retarded model color implementation
2021-04-06 00:18:04 +03:00
fgsfds
99f69eff1c throw out unused libultra sources 2020-06-21 02:21:46 +03:00
fgsfds
59cbe0ab70 update puppycam; add runtime option to disable it 2020-06-20 17:22:33 +03:00
n64
4a448cf10d merge refresh 10 2020-06-20 02:49:59 +03:00
fgsfds
2714708ca9 avoid redefining CLOCK_MONOTONIC and shit 2020-05-20 17:56:35 +03:00
Mario Reder
f99298943c fix non mingw builds
resolves #230
2020-05-20 16:50:05 +02:00
zerocloude
0c03280516
Merge pull request #93 from yksoft1/mingw.org-compatible
Making code MinGW.org and MSYS1 compatible
2020-05-19 23:45:44 +09:00
Colton Rushton
9230cb832d Refactor PR #156 2020-05-19 10:32:01 -03:00
yksoft1
753be9e1b7 Merge remote-tracking branch 'upstream/master' into mingw.org-compatible 2020-05-17 18:33:17 +08:00
fgsfds
009aef1da5
Merge pull request #132 from coltongit/patch-12
Further fixes to MXE compilation
2020-05-17 01:24:14 +03:00
Colton G. Rushton
0402ad463b
fixed MXE once and for all
thanks to @fgsfdsfgs, this is the final thing needed for MXE support
2020-05-16 19:18:50 -03:00
Colton G. Rushton
385e396feb
fix the MXE fix for os_libc.h 2020-05-16 17:21:59 -03:00
Colton G. Rushton
e42e1587b2
MXE fix for os_libc.h 2020-05-16 17:14:10 -03:00
yksoft1
1b03e251bb Better way to detect mingw-w64; fix bettercamera for mingw.org; close
.assets-local.txt before deleting it.
2020-05-15 00:26:56 +08:00
yksoft1
fa9af3227e Make the code buildable on MinGW.org (not mingw-w64) and MSYS1. 2020-05-14 23:47:00 +08:00
Hyenadae
31f0d68ca2 Removed majority of TARGET_N64 logic from code 2020-05-13 07:57:25 -04:00
Jan200101
e87c070517
merge PC port onto the decompile 2020-05-07 20:21:22 +02:00
n64
06ec56df7f Refresh 7 2020-03-01 22:42:52 -05:00
n64
9a801cb96d refresh 6 2020-02-03 00:51:26 -05:00
n64
04732af90b refresh 4 2019-12-01 21:52:53 -05:00
n64
a7c423cb43 Refresh 3 2019-11-03 14:36:27 -05:00
n64
52e605f075 Refresh 2 2019-10-05 15:08:05 -04:00
n64
1ef98ec785 Refresh 1 2019-09-01 15:50:50 -04:00
n64
89e8690857 init2 2019-08-25 00:46:40 -04:00