mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
Added viewGlow
This commit is contained in:
parent
db026d888d
commit
81f8bfb1a8
@ -87,6 +87,8 @@ class CommonFilters:
|
|||||||
needtex["bloom2"] = True
|
needtex["bloom2"] = True
|
||||||
needtex["bloom3"] = True
|
needtex["bloom3"] = True
|
||||||
auxbits |= AuxBitplaneAttrib.ABOGlow
|
auxbits |= AuxBitplaneAttrib.ABOGlow
|
||||||
|
if (configuration.has_key("ViewGlow")):
|
||||||
|
auxbits |= AuxBitplaneAttrib.ABOGlow
|
||||||
for tex in needtex:
|
for tex in needtex:
|
||||||
self.textures[tex] = Texture("scene-"+tex)
|
self.textures[tex] = Texture("scene-"+tex)
|
||||||
needtexpix = True
|
needtexpix = True
|
||||||
@ -172,6 +174,8 @@ class CommonFilters:
|
|||||||
text += "o_color = saturate(o_color);\n";
|
text += "o_color = saturate(o_color);\n";
|
||||||
text += "float4 bloom = 0.5*tex2D(k_txbloom3, l_texcoordB.xy);\n"
|
text += "float4 bloom = 0.5*tex2D(k_txbloom3, l_texcoordB.xy);\n"
|
||||||
text += "o_color = 1-((1-bloom)*(1-o_color));\n"
|
text += "o_color = 1-((1-bloom)*(1-o_color));\n"
|
||||||
|
if (configuration.has_key("ViewGlow")):
|
||||||
|
text += "o_color.r = o_color.a;\n"
|
||||||
text += "}\n"
|
text += "}\n"
|
||||||
|
|
||||||
self.finalQuad.setShader(Shader.make(text))
|
self.finalQuad.setShader(Shader.make(text))
|
||||||
@ -245,13 +249,16 @@ class CommonFilters:
|
|||||||
return self.reconfigure(True, "HalfPixelShift")
|
return self.reconfigure(True, "HalfPixelShift")
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def setFSBloom(self):
|
def setViewGlow(self):
|
||||||
fullrebuild = (self.configuration.has_key("FSBloom") == False)
|
fullrebuild = (self.configuration.has_key("ViewGlow") == False)
|
||||||
self.configuration["FSBloom"] = 1
|
self.configuration["ViewGlow"] = 1
|
||||||
return self.reconfigure(fullrebuild, "FSBloom")
|
return self.reconfigure(fullrebuild, "ViewGlow")
|
||||||
|
|
||||||
def delFSBloom(self):
|
def delViewGlow(self):
|
||||||
if (self.configuration.has_key("FSBloom")):
|
if (self.configuration.has_key("ViewGlow")):
|
||||||
del self.configuration["FSBloom"]
|
del self.configuration["ViewGlow"]
|
||||||
return self.reconfigure(True, "FSBloom")
|
return self.reconfigure(True, "ViewGlow")
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user