-
Notifications
You must be signed in to change notification settings - Fork 11
Alpine 1.1 compat #342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Alpine 1.1 compat #342
Changes from all commits
b082b69
13782a3
7d7b2d5
75958f1
dad1b0d
74a5272
97e144c
08d827b
77896f3
8b64890
3e1095b
f301672
66e3f0f
fe19cb1
f8aedec
dd43b7b
8b7523d
460579c
470b4fd
4440cde
34eab5e
307dd7e
3a036bb
e735be7
710cea3
d3e1926
0807f0c
2cb3215
6b8c72a
51da624
95d65f1
6a038d7
e2fda8f
e1bb9c3
f6f9a89
97b328a
f61afe5
96a8cc7
550a9bb
123da35
3058985
ad48e21
633812f
c88b288
915f802
ec0eef4
514518e
42208c4
793bf17
9868c8c
0acd51d
f590839
813a670
02b0e42
c2da1c2
25e51dd
1448b02
cef8bfd
bc92076
319d021
9f4e896
ce741de
91ddc6a
daa7d81
b032b5d
adc807d
ee16866
eaad62a
cc82516
fec94dc
5d0b818
503db44
52721e3
7f30336
79ffab3
43475b0
68be7b2
7fa5f67
8031b2d
6e35b82
530d326
f0c56aa
8fd9576
2774aa3
40fe6a2
c55b630
fefe3ef
2dea04f
c5f6a29
682d61f
a13ec99
c821633
d85eede
2d654ec
aa60319
5a68ad3
92d4ba5
7e0473c
b46eaf6
c5a58cd
b0380ef
78264da
956a2b8
b968ba5
b3c37fe
9b64e36
07442bb
bd8a149
3fba6ab
dab1450
cd44590
2b123a0
a1dbd0b
478697f
ed5d48c
43cc27c
e98b348
36aacbb
c27159d
73bbe8b
980d6f2
aa2c471
5e1f1f6
2562fe5
55764f3
e6388db
b1a9c9e
6a49e64
eb7ff99
0fed1c8
f8fec28
7428635
61a39ff
ffc489a
c614aa5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,8 @@ | |
| #include "../../rf/math/quaternion.h" | ||
| #include "../../rf/v3d.h" | ||
| #include "../../rf/character.h" | ||
| #include "../../main/main.h" | ||
| #include "../../multi/multi.h" | ||
| #include "gr_d3d11.h" | ||
| #include "gr_d3d11_mesh.h" | ||
| #include "gr_d3d11_context.h" | ||
|
|
@@ -378,7 +380,7 @@ namespace df::gr::d3d11 | |
| render_caches_.clear(); | ||
| } | ||
|
|
||
| void MeshRenderer::render_v3d_vif(rf::VifLodMesh *lod_mesh, int lod_index, const rf::Vector3& pos, const rf::Matrix3& orient, const rf::MeshRenderParams& params) | ||
| void MeshRenderer::render_v3d_vif(rf::VifLodMesh *lod_mesh, int lod_index, const rf::Vector3& pos, const rf::Matrix3& orient, rf::MeshRenderParams params) | ||
| { | ||
| page_in_v3d_mesh(lod_mesh); | ||
|
|
||
|
|
@@ -389,10 +391,28 @@ namespace df::gr::d3d11 | |
| render_context_.set_index_buffer(v3d_ib_.buffer()); | ||
|
|
||
| auto render_cache = reinterpret_cast<MeshRenderCache*>(lod_mesh->render_cache); | ||
|
|
||
| const bool ir_scanner = (params.flags & MRF_SCANNER_1) != 0; | ||
| if (!ir_scanner) { | ||
| rf::Vector3 ambient_light{0.f, 0.f, 0.f}; | ||
| light_get_ambient(&ambient_light.x, &ambient_light.y, &ambient_light.z); | ||
| ambient_light *= 255.f; | ||
| // RF uses some hard-coded lights here but for now let's keep it simple | ||
| ambient_light += 40.f; | ||
| // Ignore ambient_color from params, it changes sharply and RF uses it only indirectly for | ||
| // its hard-coded lights | ||
| params.ambient_color.set( | ||
| static_cast<rf::ubyte>(std::min(ambient_light.x, 255.f)), | ||
| static_cast<rf::ubyte>(std::min(ambient_light.y, 255.f)), | ||
| static_cast<rf::ubyte>(std::min(ambient_light.z, 255.f)), | ||
| 255 | ||
| ); | ||
| } | ||
|
|
||
| draw_cached_mesh(lod_mesh, *render_cache, params, lod_index); | ||
| } | ||
|
|
||
| void MeshRenderer::render_character_vif(rf::VifLodMesh *lod_mesh, int lod_index, const rf::Vector3& pos, const rf::Matrix3& orient, const rf::CharacterInstance *ci, const rf::MeshRenderParams& params) | ||
| void MeshRenderer::render_character_vif(rf::VifLodMesh *lod_mesh, int lod_index, const rf::Vector3& pos, const rf::Matrix3& orient, const rf::CharacterInstance *ci, rf::MeshRenderParams params) | ||
| { | ||
| page_in_character_mesh(lod_mesh); | ||
| auto render_cache = reinterpret_cast<CharacterMeshRenderCache*>(lod_mesh->render_cache); | ||
|
|
@@ -416,6 +436,18 @@ namespace df::gr::d3d11 | |
| } | ||
| render_cache->update_bone_transforms_buffer(ci, render_context_); | ||
| render_cache->bind_buffers(render_context_, morphed); | ||
|
|
||
| const bool ir_scanner = (params.flags & MRF_SCANNER_1) != 0; | ||
| if (!ir_scanner) { | ||
| const bool allow_full_bright = !(get_remote_server_info() | ||
| && !get_remote_server_info().value().allow_full_bright_entities); | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there should be no negation or it should be "deny", not "allow", because currently it makes no sense
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. seems clearer in expressions e.g. |
||
| if (g_game_config.full_bright_entities | ||
| && allow_full_bright | ||
| && !(params.flags & MRF_FIRST_PERSON)) { | ||
| params.ambient_color.set(255, 255, 255, 255); | ||
| } | ||
| } | ||
|
|
||
| draw_cached_mesh(lod_mesh, *render_cache, params, lod_index); | ||
| } | ||
|
|
||
|
|
@@ -458,20 +490,7 @@ namespace df::gr::d3d11 | |
| } | ||
| rf::Color color{255, 255, 255}; | ||
| if (!ir_scanner) { | ||
| // Ignore ambient_color from params, it changes sharply and RF uses it only indirectly for | ||
| // its hard-coded lights | ||
| float ambient_r, ambient_g, ambient_b; | ||
| light_get_ambient(&ambient_r, &ambient_g, &ambient_b); | ||
| color.set( | ||
| static_cast<rf::ubyte>(ambient_r * 255.0f), | ||
| static_cast<rf::ubyte>(ambient_g * 255.0f), | ||
| static_cast<rf::ubyte>(ambient_b * 255.0f), | ||
| 255 | ||
| ); | ||
| // RF uses some hard-coded lights here but for now let's keep it simple | ||
| color.red += 40; | ||
| color.green += 40; | ||
| color.blue += 40; | ||
| color = params.ambient_color; | ||
| } else { | ||
| color = params.self_illum; | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why it was moved? I can see in RF code that those builtin lights are used for characters too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is in
render_v3d_vifwhich is for e.g. item pickups. Characters are lighted inrender_character_vif.