Ejemplo n.º 1
0
Archivo: Stage.py Proyecto: vemel/fofix
    def render(self, visibility):
        if self.mode != 3:
            self.renderBackground()
        self.renderLayers(self.backgroundLayers, visibility)
        if shaders.enable("stage"):
            height = 0.0
            for i in shaders.var["color"].keys():
                shaders.modVar("color", shaders.var["color"][i], 0.05, 10.0)
                height += shaders.var["color"][i][3] / 3.0
            height = height**2
            shaders.setVar("height", 2 * height)
            shaders.setVar("ambientGlow", height / 1.5)

            shaders.setVar("glowStrength", 60 + height * 80.0)
            glBegin(GL_TRIANGLE_STRIP)
            glVertex3f(-8.0, 1.0, 7.0)
            glVertex3f(8.0, 1.0, 7.0)
            glVertex3f(-8.0, 4.0, 7.0)
            glVertex3f(8.0, 4.0, 7.0)
            glEnd()
            shaders.disable()

        self.scene.renderGuitar()
        self.renderLayers(self.foregroundLayers, visibility)
        self.rockmeter.render(visibility)
Ejemplo n.º 2
0
    def render(self, visibility):
        if self.mode != 3:
            self.renderBackground()
        self.renderLayers(self.backgroundLayers, visibility)
        if shaders.enable("stage"):
            height = 0.0
            for i in shaders.var["color"].keys():
                shaders.modVar("color",shaders.var["color"][i],0.05,10.0)
                height += shaders.var["color"][i][3]/3.0
            height=height**2
            shaders.setVar("height",2*height)
            shaders.setVar("ambientGlow",height/1.5)

            shaders.setVar("glowStrength",60+height*80.0)
            glBegin(GL_TRIANGLE_STRIP)
            glVertex3f(-8.0, 1.0,7.0)
            glVertex3f(8.0, 1.0,7.0)
            glVertex3f(-8.0, 4.0,7.0)
            glVertex3f(8.0, 4.0,7.0)
            glEnd()
            shaders.disable()

        self.scene.renderGuitar()
        self.renderLayers(self.foregroundLayers, visibility)
        self.rockmeter.render(visibility)
Ejemplo n.º 3
0
    def drawSideBars(self, visibility, song, pos):
        if not song:
            return
        if not song.readyToGo:
            return

        v = visibility
        w = self.boardWidth + 0.15

        if self.failcount == v:
            board_col = self.board_col_flash
        else:
            board_col = self.board_col

        glEnable(GL_TEXTURE_2D)

        if self.instrument.starPowerActive and self.oSideBars and not (
                self.guitarSolo or self.soloSideBars):
            self.oSideBars.texture.bind()
        elif self.instrument.starPowerActive and self.oSoloSideBars and self.oSidebars and self.guitarSolo:
            self.oSoloSideBars.texture.bind()
        elif self.guitarSolo and self.soloSideBars:
            self.soloSideBars.texture.bind()
        elif self.sideBars:
            self.sideBars.texture.bind()

        if self.isFailing and self.failSideBars and v == self.failcount:
            self.failSideBars.texture.bind()

        cmgl.drawArrays(GL_TRIANGLE_STRIP,
                        vertices=self.sidebars_vtx,
                        colors=board_col,
                        texcoords=self.board_tex)
        glDisable(GL_TEXTURE_2D)

        if shaders.enable("sololight"):
            shaders.modVar("color", shaders.var["solocolor"])
            shaders.setVar("offset", (-3.5, -w / 2))
            cmgl.drawArrays(GL_TRIANGLE_STRIP, vertices=self.soloLightVtx1)
            shaders.setVar("offset", (-3.5, w / 2))
            shaders.setVar("time", shaders.time() + 0.5)
            cmgl.drawArrays(GL_TRIANGLE_STRIP, vertices=self.soloLightVtx2)
            shaders.disable()
Ejemplo n.º 4
0
    def drawSideBars(self, visibility, song, pos):
        if not song:
            return
        if not song.readyToGo:
            return

        v = visibility
        w = self.boardWidth + 0.15

        if self.failcount == v:
            board_col = self.board_col_flash
        else:
            board_col = self.board_col

        glEnable(GL_TEXTURE_2D)

        if self.instrument.starPowerActive and self.oSideBars and not (self.guitarSolo or self.soloSideBars):
            self.oSideBars.texture.bind()
        elif self.instrument.starPowerActive and self.oSoloSideBars and self.oSidebars and self.guitarSolo:
            self.oSoloSideBars.texture.bind()
        elif self.guitarSolo and self.soloSideBars:
            self.soloSideBars.texture.bind()
        elif self.sideBars:
            self.sideBars.texture.bind()



        if self.isFailing and self.failSideBars and v == self.failcount:
            self.failSideBars.texture.bind()

        cmgl.drawArrays(GL_TRIANGLE_STRIP, vertices=self.sidebars_vtx, colors=board_col, texcoords=self.board_tex)
        glDisable(GL_TEXTURE_2D)

        if shaders.enable("sololight"):
            shaders.modVar("color",shaders.var["solocolor"])
            shaders.setVar("offset",(-3.5,-w/2))
            cmgl.drawArrays(GL_TRIANGLE_STRIP, vertices=self.soloLightVtx1)
            shaders.setVar("offset",(-3.5,w/2))
            shaders.setVar("time",shaders.time()+0.5)
            cmgl.drawArrays(GL_TRIANGLE_STRIP, vertices=self.soloLightVtx2)
            shaders.disable()
Ejemplo n.º 5
0
    def render(self, visibility, song, pos, controls, killswitch):

        if shaders.turnon:
            shaders.globals["dfActive"] = self.drumFillsActive
            shaders.globals["breActive"] = self.freestyleActive
            shaders.globals["rockLevel"] = self.rockLevel
            if shaders.globals["killswitch"] != killswitch:
                shaders.globals["killswitchPos"] = pos
            shaders.globals["killswitch"] = killswitch
            shaders.modVar("height",0.2,0.2,1.0,"tail")


        if not self.starNotesSet == True:
            self.totalNotes = 0


            for time, event in song.track[self.player].getAllEvents():
                if not isinstance(event, Note):
                    continue
                self.totalNotes += 1


            stars = []
            maxStars = []
            maxPhrase = self.totalNotes/120
            for q in range(0,maxPhrase):
                for n in range(0,10):
                    stars.append(self.totalNotes/maxPhrase*(q)+n+maxPhrase/4)
                maxStars.append(self.totalNotes/maxPhrase*(q)+10+maxPhrase/4)
            i = 0
            for time, event in song.track[self.player].getAllEvents():
                if not isinstance(event, Note):
                    continue
                for a in stars:
                    if i == a:
                        self.starNotes.append(time)
                        event.star = True
                for a in maxStars:
                    if i == a:
                        self.maxStars.append(time)
                        event.finalStar = True
                i += 1
            for time, event in song.track[self.player].getAllEvents():
                if not isinstance(event, Note):
                    continue
                for q in self.starNotes:
                    if time == q:
                        event.star = True
                for q in self.maxStars:
                    if time == q:   #MFH - no need to mark only the final SP phrase note as the finalStar as in drums, they will be hit simultaneously here.
                        event.finalStar = True
            self.starNotesSet = True

        if not (self.coOpFailed and not self.coOpRestart):
            glEnable(GL_BLEND)
            glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
            glEnable(GL_COLOR_MATERIAL)

            if self.leftyMode:
                if not self.battleStatus[6]:
                    glScalef(-1, 1, 1)
            elif self.battleStatus[6]:
                glScalef(-1, 1, 1)

            if self.freestyleActive:
                self.renderFreestyleLanes(visibility, song, pos, None) #MFH - render the lanes on top of the notes.
                self.renderFrets(visibility, song, controls)

                self.renderFreestyleFlames(visibility, controls)    #MFH - freestyle hit flames

            else:
                self.renderTails(visibility, song, pos, killswitch)
                if self.fretsUnderNotes:  #MFH
                    if self.twoDnote == True:
                        self.renderFrets(visibility, song, controls)
                        self.renderNotes(visibility, song, pos)
                    else:
                        self.renderNotes(visibility, song, pos)
                        self.renderFrets(visibility, song, controls)
                else:
                    self.renderNotes(visibility, song, pos)
                    self.renderFrets(visibility, song, controls)

                self.renderFreestyleLanes(visibility, song, pos, None) #MFH - render the lanes on top of the notes.


                self.renderHitGlow()
                self.renderHitTrails(controls)
                self.renderAnimatedFlames(song, pos)
                self.renderFlames(song, pos)    #MFH - only when freestyle inactive!

            if self.leftyMode:
                if not self.battleStatus[6]:
                    glScalef(-1, 1, 1)
            elif self.battleStatus[6]:
                glScalef(-1, 1, 1)