Conversation
|
Don't post links to executable here please. Use Zulip for that. |
|
Please only share executables through Zulip. The example that you share here is a mesh blueprint. Does this apply to all mesh blueprints? For example, would it apply to props? Does it apply to other LOD values, such as those of emitters? edit: Ha, @4z0t beat me to it 😄 ! |
|
First glance at code: too much asm to process and check. As I said before I doubt I will approve it. |
|
Yea sorry for too much asm and exe posting :). I think @Garanas Yea, it applies to any meshes (props too). Sadly, doesn't work with emitters and other things |
|
@Garanas Funny fact (it's probably well known but still) - You can disable shadows at certain zoom automatically, but the thing is that I want to see CZAR's shadow (on screenshot) and don't want small shadows when zoomed out. This is probably one more thing that needs patching :) Adding ability to disable small shadows at certain zoom |
|
Added SetSmallShadowCutoff(float distance)I'll add description to first post |
This is a great observation! |
|
@Strogoo I think this pull request can be quite meaningful. But it's important that the focus is on making it more maintainable. This also includes the comment of @4z0t at #115 (comment). I'll come with some name suggestions and other (relatively minor) adjustments later today or tomorrow. I'm trying to see what type of control we to have in Lua over these values. |
|
@Garanas Yep, as I said before I like to make raw patches in pure asm just to make sure it actually works and can be useful. Next step is polishing the code (if needed), probably in cooperation with @4z0t , since he has much more C++ experience. Feel free to suggest different namings and other things that should be changed. |
|
Here's my thoughts about these changes: Overall: positive! Especially the ability to adjust the shadow cutoff is going to be useful. I think it may be even more meaningful then the mesh group IDs because of your observation in #115 (comment). Which was not well known 😄 ! About the naming convention:
Reasoning: these values are not about vertices, triangles, textures or anything related to the mesh. They're related to the LOD values that determine when the mesh is rendered. And now that's clear. By adjusting the type of The use of I don't see the use of On the Lua side we can introduce game options as sliders to make calls to |
|
Also about |
|
Мне не нравятся, как сделаны некоторые вещи в принципе. В частности то, что ASM перемешан с C/C++. У меня пока особо времени (и желания) смотреть нет в IDA, так что если у тебя 100% уверенность, что все сделано верно и @Garanas видит необходимость в данном функционале, то я не против. Может быть у @Hdt80bro глянет, что да как. Могу сказать, что лишь в конце месяца я буду готов глянуть, ибо у меня дела IRL. |
|
Там возможно еще часть функционала уберется по итогу (смотри тему в дискорде), так что asm будет поменьше. В целом, я процентов на 90 уверен в коде. Надо просто прогнать еще в реальной игре, что б 100% крашей не было. |
|
SetLODGroupMultiplier(int group, float mult)
ApplyMultToWorstLODOnly(bool)
SetShadowCutoffGroupMultiplier(int group, float mult) -- if mult <=0 or mult >1 then mult = 1. |
|
|
||
| void ProcessBpFieldValues() | ||
| { | ||
| if (not strcmp(fieldName, meshGroupField)) //(not strcmp) == equal |
There was a problem hiding this comment.
not is something that isn't common for C/C++, use ! or == 0.
There was a problem hiding this comment.
Yea, I just hate !. It's really harder to notice compare to not. Will change to == 0 I think?
There was a problem hiding this comment.
For comparisons, == 0 is the most common because the return value isn't supposed to interpreted as a boolean - it's a three-way comparison, yielding a number less than, equal to, or greater than zero. So people use < 0, == 0, and > 0.
| [ebpStorage] "m" (ebpStorage), | ||
| [edxStorage] "m" (edxStorage) | ||
| : | ||
| ); |
There was a problem hiding this comment.
I'd prefer you change the MeshBlueprint's RType in the builder function at 0x005187F0 than adding special cases for each new RField.
There was a problem hiding this comment.
Hmm, yea I think you are right. My thought was that it would be nice to have such "dirty" hook where we check literally all bp fields at one place and then process them as we want (not necessarily adding them to RBlueprint, but mb something else). Yes it takes more time because of string compare etc., but we are at game loading screen here, so doesn't really matter.
But yes, for this exact case it's ptobably better to just change bp's RType.
| SECTION(1, 0x004CF7F2) | ||
| "jmp "QU(GetBpFieldValues)";" | ||
|
|
||
| SECTION(2, 0x004CF7F7) |
There was a problem hiding this comment.
If the two sections are that close, for the amount of reading each new section takes up, I'd rather only have one.






Added 2 functions to UI:
MeshGroupIDshould be added to Mesh blueprint (directly or via blueprints.lua). ID should be from 1 to 127. Then usingSetGroupLODMultyou can change LODCutoffs of given group on the fly.ApplyMultToWorstLODOnly()is set to False by default. This means multiplier will be applied to all avaliable LODs (LOD0, LOD1 etc). WhenTrue- only worst LOD is affected. For example:One more UI function:
Requires additional filed in mesh bp
IsSmallObject = true.SetSmallShadowCutoff(distance)default is 0 (means this check is disabled). Setting it to any number above0will disable shadows for small objects (IsSmallObject = true in mesh bp) at certain zoom level. Note thatdistanceis not acamera zoomvalue, but a distance between current camera pos and an object. So it works similar to LODs, when objects at corners dissapear a bit earlier.