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

Compile Effects #3929

Open
wants to merge 3 commits into
base: 1.4.4
Choose a base branch
from

Conversation

Destructor-Ben
Copy link
Contributor

@Destructor-Ben Destructor-Ben commented Nov 14, 2023

Porting Notes

  • Delete old compiler, remove any setup you had before related to compiling effects such as removing xnb files from the editor (this is already handled for you).
  • Effects are automatically compiled! (only on windows though)
  • If you don't want to scrap your effect compiler system yet, you can opt out with the <tMLCompileEffects> property
  • Similarly you can change the target version of the effect framework with the <tMLEffectsVersion> property, if you need more instructions

What is the new feature?

Adding effect compiling to tML.

  • .fx and .hlsl files are automatically compiled using fxc to an .fxc file
  • Ships fxc with tML so we can add Mac and Linux support with wine at some point
  • Can disable with a property in the mod's csproj
  • Can also use the csproj to change the effect version thingy being used to the following:
    • fx_2_0 - Default
    • fx_4_0
    • fx_4_1
    • fx_5_0

Also cleaned up the old .fx files in EM and fixed an alpha issue with the ExampleDye.

Closes #3326

Why should this be part of tModLoader?

At the moment third party compilers or a custom build task are required to get effects compiling, which can be confusing for users (though shaders are confusing sometimes anyway, especially premultiplication)

Are there alternative designs?

Yes, discussed a bit on the Discord in #collaborators, but involves using other compilers such as EasyXNB or dxc. There is also the possibility of doing the compiling in a C# build task or doing it in the ModCompile class.

Sample usage for the new feature

See ExampleMod and compile it, then run it.

ExampleMod updates

Deleted old xnb files.

Possible TODOs

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

Successfully merging this pull request may close these issues.

Compile Shaders
1 participant