I’ve got a shader based on James O’Hares’ fantabulous skin shader, where something is wrapped with the SHADER_API_D3D11. The problem is that the caller is a PS 3.0 targeted shader. To me, either SHADER_API_D3D11 should be omitted if the caller is PS 3.0, or we should get a TARGET_PS3 preprocessor directive.
I think it’s more of a minimum rather than an absolute target.
SM3 stuff will run on SM5 (DX11) hardware.
You can use
#pragma only_renderers
or
#pragma exclude_renderers
to stop it compiling to platforms you don’t want.
Sort of. Its complaining about mapping to the fine derivative calls (ddx_fine etc), so while it should work, the directives are telling it to use ddx_fine and it doesn’t really know what to do with it. For now flength does the job, but it is something that could be addressed more elegantly.
Oh, Unity crashes outright when I turn it to DX11 mode, so I wrote that stuff blind ![]()
ddx_fine should be SM5/DX11 only command, though, that’s why I wrapped them up.
In DX11 mode, Shader Model 3 shaders tend to work better if you target 5.0. Otherwise they’ll automatically target SM 4.0