Skip to content
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

[SDK V2] Control over renderer state groups #433

Open
2 tasks done
skymen opened this issue Jan 17, 2025 · 0 comments
Open
2 tasks done

[SDK V2] Control over renderer state groups #433

skymen opened this issue Jan 17, 2025 · 0 comments

Comments

@skymen
Copy link

skymen commented Jan 17, 2025

Reviewed guidelines

  • I have read and understand the suggestion guidelines

Checked for duplicate suggestions

  • I checked for existing similar suggestions

Summary

For my addon Empty Shell, I have a color fill mode and I used undocumented rendering code to make color filled empty shells render a LOT faster

Possible workarounds or alternatives

no workaround or alternative

Proposed solution

I just need to be able to port this:

_UpdateRendererStateGroup() {
  const renderer = this._runtime.GetRenderer();
  const wi = this.GetWorldInfo();
  if (wi._stateGroup) renderer.ReleaseStateGroup(wi._stateGroup);
  let shaderProgram;
  if (this.useColorFill) shaderProgram = renderer._spColorFill || "<fill>";
  else
    shaderProgram = renderer.GetTextureFillShaderProgram() || "<default>";
  wi._stateGroup = renderer.AcquireStateGroup(
    shaderProgram,
    wi.GetBlendMode(),
    wi._colorPremultiplied,
    wi.GetZElevation()
  );
}

Why is this idea important?

I need it to port my addon

Additional remarks

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant