Ejemplo n.º 1
0
 def __init__(self, color: Vector, strength: float, position: Point3D,
              direction: Point3D, fov: float, isCircular: bool):
     Light.__init__(self, color, strength)
     self.position = position
     self.direction = direction
     self.fov = fov
     self.isCircular = isCircular
    def __init__(self):
        Light.__init__(self)
        DebugObject.__init__(self, "DirectionalLight")

        self._spacing = 0.6
        self.radius = 99999999999.0
        self.position = Vec3(0)
        self.bounds = OmniBoundingVolume()
Ejemplo n.º 3
0
 def __init__(self):
     """ Creates a new point light. Remember to set a position
     and a radius """
     Light.__init__(self)
     DebugObject.__init__(self, "PointLight")
     self.spacing = 0.5
     self.bufferRadius = 0.0
     self.typeName = "PointLight"
Ejemplo n.º 4
0
 def __init__(self):
     """ Creates a new point light. Remember to set a position
     and a radius """
     Light.__init__(self)
     DebugObject.__init__(self, "PointLight")
     self.spacing = 0.5
     self.bufferRadius = 0.0
     self.typeName = "PointLight"
Ejemplo n.º 5
0
    def __init__(self):
        """ Constructs a new directional light. You have to set a
        direction for this light to work properly"""
        Light.__init__(self)
        DebugObject.__init__(self, "DirectionalLight")
        self.typeName = "DirectionalLight"

        # A directional light is always visible
        self.bounds = OmniBoundingVolume()
Ejemplo n.º 6
0
    def __init__(self, lightName, lightNum, 
                    ambient = Light.ambientDefault,
                    diffuse = Light.diffuseDefault, 
                    specular = Light.specularDefault,
                    direction = directionDefault):
        
        Light.__init__(self, lightName, lightNum, ambient, diffuse, specular)

        self.__direction = Vec3d(direction[0], direction[1], direction[2], 0.0)
Ejemplo n.º 7
0
 def __init__(self):
     """ Constructs a new directional light. You have to set a
     direction for this light to work properly"""
     Light.__init__(self)
     DebugObject.__init__(self, "GIHelperLight")
     self.typeName = "GIHelperLight"
     self.targetLight = None
     self.filmSize = 50
     self.bounds = OmniBoundingVolume()
Ejemplo n.º 8
0
    def __init__(self):
        """ Constructs a new directional light. You have to set a
        direction for this light to work properly"""
        Light.__init__(self)
        DebugObject.__init__(self, "DirectionalLight")
        self.typeName = "DirectionalLight"
        self.splitCount = 4
        self.pssmTargetCam = None
        self.pssmTargetLens = None
        self.pssmFarPlane = 100.0
        self.pssmSplitPow = 2.0
        self.updateIndex = 0

        # A directional light is always visible
        self.bounds = OmniBoundingVolume()
Ejemplo n.º 9
0
    def __init__(self, lightName, lightNum, 
                    ambient = Light.ambientDefault,
                    diffuse = Light.diffuseDefault, 
                    specular = Light.specularDefault,
                    position = positionDefault,
                    atConstant = constantAttenuationDefault,
                    atLinear = linearAttenuationDefault,
                    atQuadratic = quadraticAttnuationDefault):

        Light.__init__(self, lightName, lightNum, ambient, diffuse, specular)

        self.__position = Vec3d(position[0], position[1], position[2], 1)

        self.__atConstant = atConstant
        self.__atLinear = atLinear
        self.__atQuadratic = atQuadratic
Ejemplo n.º 10
0
    def __init__(self):
        """ Creates a new spot light. """
        Light.__init__(self)
        DebugObject.__init__(self, "SpotLight")
        self.typeName = "SpotLight"

        self.nearPlane = 0.5
        self.radius = 30.0
        self.spotSize = Vec2(30, 30)

        # Used to compute the MVP
        self.ghostCamera = Camera("PointLight")
        self.ghostCamera.setActive(False)
        self.ghostLens = PerspectiveLens()
        self.ghostLens.setFov(130)
        self.ghostCamera.setLens(self.ghostLens)
        self.ghostCameraNode = NodePath(self.ghostCamera)
        self.ghostCameraNode.reparentTo(Globals.render)
        self.ghostCameraNode.hide()
Ejemplo n.º 11
0
    def __init__(self):
        """ Constructs a new directional light. You have to set a
        direction for this light to work properly"""
        Light.__init__(self)
        DebugObject.__init__(self, "DirectionalLight")
        self.typeName = "DirectionalLight"

        # If you change the split count, change DIRECTIONAL_LIGHT_SPLIT_COUNTS
        # in Shader/Includes/Configuration.include aswell! This is hardcoded
        # to improve performance
        self.splitCount = 5

        self.pssmTargetCam = Globals.base.cam
        self.pssmTargetLens = Globals.base.camLens
        self.pssmFarPlane = 150.0
        self.pssmSplitPow = 2.0
        self.updateIndex = 0

        # A directional light is always visible
        self.bounds = OmniBoundingVolume()
Ejemplo n.º 12
0
    def __init__(self):
        """ Constructs a new directional light. """
        Light.__init__(self)
        DebugObject.__init__(self, "DirectionalLight")
        self.typeName = "DirectionalLight"

        # If you change the split count, change DIRECTIONAL_LIGHT_SPLIT_COUNTS
        # in Shader/Includes/Configuration.include aswell! This is hardcoded
        # to improve performance
        self.splitCount = 6

        self.pssmTargetCam = Globals.base.cam
        self.pssmTargetLens = Globals.base.camLens
        self.pssmFarPlane = 150
        self.pssmSplitPow = 2.0
        self.sunDistance = 7000
        self.updateIndex = 0

        # A directional light is always visible
        self.bounds = OmniBoundingVolume()
Ejemplo n.º 13
0
 def __init__(self, color:Color, strength:float, sceneObject:SceneObject):
     Light.__init__(self, color, strength)
     self.sceneObject = sceneObject
Ejemplo n.º 14
0
 def __init__(self, color: Color, strength: float, position: Point3D):
     Light.__init__(self, color, strength)
     self.position = position
Ejemplo n.º 15
0
 def __init__(self, color: Vector, strength: float, direction: Vector):
     Light.__init__(self, color, strength)
     self.direction = direction
Ejemplo n.º 16
0
 def __init__(self):
     Light.__init__(self)
     DebugObject.__init__(self, "PointLight")
     self._spacing = 0.6
     self._bufferRadius = 1.0
     self.typeName = "PointLight"