mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 18:03:56 -04:00
CommonFilters: better handle failure condition when shaders not supported
This commit is contained in:
parent
5980b0b9ab
commit
47c7ff42cc
@ -131,6 +131,9 @@ class CommonFilters:
|
|||||||
if (len(configuration) == 0):
|
if (len(configuration) == 0):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if not self.manager.win.gsg.getSupportsBasicShaders():
|
||||||
|
return False
|
||||||
|
|
||||||
auxbits = 0
|
auxbits = 0
|
||||||
needtex = set(["color"])
|
needtex = set(["color"])
|
||||||
needtexcoord = set(["color"])
|
needtexcoord = set(["color"])
|
||||||
@ -338,7 +341,10 @@ class CommonFilters:
|
|||||||
text += " o_color = float4(1, 1, 1, 1) - o_color;\n"
|
text += " o_color = float4(1, 1, 1, 1) - o_color;\n"
|
||||||
text += "}\n"
|
text += "}\n"
|
||||||
|
|
||||||
self.finalQuad.setShader(Shader.make(text, Shader.SL_Cg))
|
shader = Shader.make(text, Shader.SL_Cg)
|
||||||
|
if not shader:
|
||||||
|
return False
|
||||||
|
self.finalQuad.setShader(shader)
|
||||||
for tex in self.textures:
|
for tex in self.textures:
|
||||||
self.finalQuad.setShaderInput("tx"+tex, self.textures[tex])
|
self.finalQuad.setShaderInput("tx"+tex, self.textures[tex])
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user