Пример #1
0
 def addShaderAttributes(self, shaderFunc):
     """
     adds a per vertex shader attribute.
     """
     FaceVArray.addShaderAttributes(self, shaderFunc)
     if self.hasTangents():
         shaderFunc.addAttribute(type="vec4", name="vertexTangent")
Пример #2
0
 def __init__(self, name, params):
     self.tangents = params.get('vertexTangent')
     
     conf = params.get('tangentsConf')
     if conf!=None and conf.dynamic:
         self.dynamicTangents = True
     else:
         self.dynamicTangents = False
     
     FaceVArray.__init__(self, name, params)
Пример #3
0
 def duplicatePerVertexAttribute(self, index):
     FaceVArray.duplicatePerVertexAttribute(self, index)
     if self.hasTangents():
         # FIXME: TSPACE: for different per face uv tangents cant be duplicated like this,
         #                    because their calculation depends on the uv values
         self.tangents.data.append(self.tangents.data[index])
Пример #4
0
 def postCreate(self):
     FaceVArray.postCreate(self)
     del self.tangents
Пример #5
0
 def createVBOs(self):
     """
     add tangent attribute before creating the vbos.
     """
     self.addAttribute(self.tangents)
     FaceVArray.createVBOs(self)
Пример #6
0
 def isDynamicAttribute(self, attribute):
     if self.tangents==attribute:
         return self.dynamicTangents
     else:
         return FaceVArray.isDynamicAttribute(self, attribute)
Пример #7
0
 def createResources(self):
     FaceVArray.createResources(self)
     if self.needTangents():
         self.tangents = self.generateTangents()