TrueCraft icon indicating copy to clipboard operation
TrueCraft copied to clipboard

Custom client shader

Open ddevault opened this issue 9 years ago • 7 comments

We need to replace BasicEffect and AlphaTestEffect with our own shaders so we can start to branch out into areas like lighting and more effective biome colors.

ddevault avatar Jun 23 '15 21:06 ddevault

Ouch, after looking into this it seems that MonoGame uses a custom 'compiled' shader format using a tool that comes with the SDK, you give it an .fx file and it spits out a cross-platform MonoGame version. The tool also only works on Windows. Compiled shaders supposedly work on all platforms, at least.

moorehousew avatar Jun 24 '15 14:06 moorehousew

http://www.monogame.net/documentation/?page=Custom_Effects

It's not single platform, we can do it during our build on all platforms without too much trouble. The hard part is going to be convincing MSBuild to add a custom build step for it.

ddevault avatar Jun 24 '15 15:06 ddevault

I've got a custom shader compiled and loaded without issue, however it doesn't seem to render anything...

moorehousew avatar Jun 24 '15 15:06 moorehousew

Well, what does your shader look like?

ddevault avatar Jun 24 '15 15:06 ddevault

Nevermind, I've written the shader with shader model 3+ and shader model 2 functions mixed in. How that compiled is beyond me.

moorehousew avatar Jun 24 '15 15:06 moorehousew

Ah, alright then.

ddevault avatar Jun 24 '15 15:06 ddevault

This change is postponed, see discussion in #169.

ddevault avatar Jun 25 '15 22:06 ddevault