Jump to content

Shaders not supported


Recommended Posts

So I made 3 shaders for KSP, all of them seem to work fine in unity and all of them use shader model 4.0. However, after I loaded them in KSP, one works and the two others don't.

After checking each shader with isSupported I get the following

Atmo/Sky (UnityEngine.Shader)
False
Atmo/SkyMap (UnityEngine.Shader)
False
EncodeFloat/DecodeToFloat (UnityEngine.Shader)
True

What could be the reason for this? All three shaders were made for dx9, all three of them use rendertextures but don't use compute shaders. And I used the snippet of code to load all three, i'm at a loss here...

Edit: As it turns out, my shaders will run by forcing d3d11 or opengl but not d3d9 or d3d10 for some reason.

Edited by blackrack
Link to comment
Share on other sites

I have modified my shaders, they now compile correctly for directx 9 and unity reports shader model 3.0, however, ingame it still says they are unsupported andf won't load. What could it be that I am missing? Does anybody have any guidelines or something?

I have removed a few tex2Dlod calls and changed my code to work with tex2d instead.

Edit: After adding #pragma only_renderers d3d9, unity now reports:No subshaders can run on this graphics card. No idea why.

Edited by blackrack
Link to comment
Share on other sites

My shaders now work in dx9, sort of

77jOuIG.jpg

Are there any mathematic operators in CG that work differently from dx9 to dx11? Maybe some flipped matrixes? I'm trying to narrow it down but can't really find anything .

Edit: I finally fixed this, turns out sqrt in dx9 is less precise than in dx11.

Edited by blackrack
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...