feat(extra-natives/five): add support for configurable outline render technique#3365
Merged
Merged
Conversation
Collaborator
|
Could you please revert all formatting changes so we can see only real changes |
… technique Introduce `SET_ENTITY_DRAW_OUTLINE_RENDER_TECHNIQUE` to allow specifying custom shader technique groups for entity outlines, with a fallback to the default "unlit" technique. Introduce `RESET_ENTITY_DRAW_OUTLINE_RENDER_TECHNIQUE` native to restore the outline render technique to the default value.
prikolium-cfx
approved these changes
Apr 30, 2025
Collaborator
|
I've marked this PR as ready-to-merge, but looks like it needs manual testing as some part of code called in different thread and it can cause issues when setting global var. |
Contributor
Author
|
@prikolium-cfx Do you have an approach in mind? I'm considering mutexes for thread safety, wdyt? |
|
|
||
| fx::ScriptEngine::RegisterNativeHandler("SET_ENTITY_DRAW_OUTLINE_RENDER_TECHNIQUE", [](fx::ScriptContext& context) | ||
| { | ||
| std::string techniqueGroupId = context.GetArgument<const char*>(0); |
Contributor
There was a problem hiding this comment.
Suggested change
| std::string techniqueGroupId = context.GetArgument<const char*>(0); | |
| std::string techniqueGroupId = context.CheckArgument<const char*>(0); |
Using CheckArgument here will make this error if index 0 is null
Contributor
Author
There was a problem hiding this comment.
Good point! I thought the type checking in natives would handle that. I'll do some tests and fix it in upcoming commits
|
Bump to not stale |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Goal of this PR
Allow developers to specify a custom shader technique group for entity outlines via a new native (

SET_ENTITY_DRAW_OUTLINE_RENDER_TECHNIQUE). This expands the flexibility of the outline rendering system, which was previously limited to the unlit technique, and addresses use cases beyond the intended FxDK environment, as some developers rely on this functionality in their own codebases.How is this PR achieving the goal
Introduces the
SET_ENTITY_DRAW_OUTLINE_RENDER_TECHNIQUEnative, allowing scripts to specify a custom shader technique group for entity outlines. The implementation updates the outline rendering system to use the provided technique group, with a fallback to the default "unlit" technique if none is specified. This expands the flexibility of outline rendering for both FxDK and community use cases.This PR applies to the following area(s)
Natives, FxDK
Successfully tested on
Game builds: 1604, 3095, 3258, 3407
Platforms: Windows
Checklist
Fixes issues