Esempio n. 1
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)
Esempio 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)
Esempio n. 3
0
  def drawSideBars(self, visibility, song, pos):
    if not song:
      return
    if not song.readyToGo:
      return

    def project(beat):
      return 0.125 * beat / self.beatsPerUnit  # glorandwarf: was 0.12

    v            = visibility
    w            = self.boardWidth + 0.15
    l            = self.boardLength

    offset       = (pos - self.lastBpmChange) / self.currentPeriod + self.baseBeat 

    c = (1,1,1)

    board_tex  = np.array([[0.0, project(offset - 2 * self.beatsPerUnit)],
                         [1.0, project(offset - 2 * self.beatsPerUnit)],
                         [0.0, project(offset - 1 * self.beatsPerUnit)],
                         [1.0, project(offset - 1 * self.beatsPerUnit)],
                         [0.0, project(offset + l * self.beatsPerUnit * .7)],
                         [1.0, project(offset + l * self.beatsPerUnit * .7)],
                         [0.0, project(offset + l * self.beatsPerUnit)],
                         [1.0, project(offset + l * self.beatsPerUnit)]], dtype=np.float32)

    glEnable(GL_TEXTURE_2D)
    if self.theme == 2 and self.instrument.starPowerActive and self.oSideBars:
      self.oSideBars.texture.bind()
    else:
      self.sideBars.texture.bind()

    cmgl.drawArrays(GL_TRIANGLE_STRIP, vertices=self.sidebars_vtx, colors=self.board_col, texcoords=board_tex)
    
    glDisable(GL_TEXTURE_2D)
    
    if self.theme == 1:   
      if shaders.enable("sololight"):
        shaders.modVar("color",shaders.var["solocolor"])
        shaders.setVar("offset",(-3.5,-w/2))
        glBegin(GL_TRIANGLE_STRIP)
        glVertex3f(w / 2-1.0, 0.4, -2)
        glVertex3f(w / 2+1.0, 0.4, -2)
        glVertex3f(w / 2-1.0, 0.4, l)
        glVertex3f(w / 2+1.0, 0.4, l)
        glEnd()   
        shaders.setVar("offset",(-3.5,w/2))
        shaders.setVar("time",shaders.time()+0.5)
        glBegin(GL_TRIANGLE_STRIP)
        glVertex3f(-w / 2+1.0, 0.4, -2)
        glVertex3f(-w / 2-1.0, 0.4, -2)
        glVertex3f(-w / 2+1.0, 0.4, l)
        glVertex3f(-w / 2-1.0, 0.4, l)
        glEnd()  
        shaders.disable()
Esempio n. 4
0
  def drawSideBars(self, visibility, song, pos):
    if not song:
      return
    if not song.readyToGo:
      return

    color = (1,1,1)

    v            = visibility
    w            = self.boardWidth + 0.15
    l            = self.boardLength

    offset       = (pos - self.lastBpmChange) / self.currentPeriod + self.baseBeat 

    board_tex  = np.array([[0.0, self.project(offset - 2 * self.beatsPerUnit)],
                         [1.0, self.project(offset - 2 * self.beatsPerUnit)],
                         [0.0, self.project(offset - 1 * self.beatsPerUnit)],
                         [1.0, self.project(offset - 1 * self.beatsPerUnit)],
                         [0.0, self.project(offset + l * self.beatsPerUnit * .7)],
                         [1.0, self.project(offset + l * self.beatsPerUnit * .7)],
                         [0.0, self.project(offset + l * self.beatsPerUnit)],
                         [1.0, self.project(offset + l * self.beatsPerUnit)]], dtype=np.float32)

    #must be separate for sidebar flashing.
    board_col  = np.array([[color[0],color[1],color[2], 0],
                             [color[0],color[1],color[2], 0],
                             [color[0],color[1],color[2], v],
                             [color[0],color[1],color[2], v],
                             [color[0],color[1],color[2], v],
                             [color[0],color[1],color[2], v],
                             [color[0],color[1],color[2], 0],
                             [color[0],color[1],color[2], 0]], dtype=np.float32)

    glEnable(GL_TEXTURE_2D)
    if self.instrument.starPowerActive and self.oSideBars:
      self.oSideBars.texture.bind()
    else:
      self.sideBars.texture.bind()
    if self.isFailing and self.failSideBars and v == self.failcount:
      self.failSideBars.texture.bind()
    else:
      self.sideBars.texture.bind()
    cmgl.drawArrays(GL_TRIANGLE_STRIP, vertices=self.sidebars_vtx, colors=board_col, texcoords=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()
Esempio n. 5
0
File: Neck.py Progetto: chk666/fofix
    def drawSideBars(self, visibility, song, pos):
        if not song:
            return
        if not song.readyToGo:
            return

        color = (1,1,1)

        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()
Esempio n. 6
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()
Esempio n. 7
0
  def drawSideBars(self, visibility, song, pos):
    if not song:
      return
    if not song.readyToGo:
      return

    def project(beat):
      return 0.125 * beat / self.beatsPerUnit  # glorandwarf: was 0.12

    v            = visibility
    w            = self.boardWidth + 0.15
    l            = self.boardLength

    offset       = (pos - self.lastBpmChange) / self.currentPeriod + self.baseBeat 

    c = (1,1,1)

    board_tex  = array([[0.0, project(offset - 2 * self.beatsPerUnit)],
                         [1.0, project(offset - 2 * self.beatsPerUnit)],
                         [0.0, project(offset - 1 * self.beatsPerUnit)],
                         [1.0, project(offset - 1 * self.beatsPerUnit)],
                         [0.0, project(offset + l * self.beatsPerUnit * .7)],
                         [1.0, project(offset + l * self.beatsPerUnit * .7)],
                         [0.0, project(offset + l * self.beatsPerUnit)],
                         [1.0, project(offset + l * self.beatsPerUnit)]], dtype=float32)

    glEnable(GL_TEXTURE_2D)
    if self.theme == 2 and self.starPowerActive and self.oSideBars:
      self.oSideBars.texture.bind()
    else:
      self.sideBars.texture.bind()

    glEnableClientState(GL_VERTEX_ARRAY)
    glEnableClientState(GL_COLOR_ARRAY)
    glEnableClientState(GL_TEXTURE_COORD_ARRAY);
    glVertexPointerf(self.sidebars_vtx)
    glColorPointerf(self.board_col)
    glTexCoordPointerf(board_tex)
    glDrawArrays(GL_TRIANGLE_STRIP, 0, self.sidebars_vtx.shape[0])
    glDisableClientState(GL_VERTEX_ARRAY)
    glDisableClientState(GL_COLOR_ARRAY)
    glDisableClientState(GL_TEXTURE_COORD_ARRAY);
    
    glDisable(GL_TEXTURE_2D)
    
    if self.theme == 1:   
      if shaders.enable("sololight"):
        shaders.modVar("color",shaders.var["solocolor"])
        shaders.setVar("offset",(-3.5,-w/2))
        glBegin(GL_TRIANGLE_STRIP)
        glVertex3f(w / 2-1.0, 0.4, -2)
        glVertex3f(w / 2+1.0, 0.4, -2)
        glVertex3f(w / 2-1.0, 0.4, l)
        glVertex3f(w / 2+1.0, 0.4, l)
        glEnd()   
        shaders.setVar("offset",(-3.5,w/2))
        shaders.setVar("time",shaders.time()+0.5)
        glBegin(GL_TRIANGLE_STRIP)
        glVertex3f(-w / 2+1.0, 0.4, -2)
        glVertex3f(-w / 2-1.0, 0.4, -2)
        glVertex3f(-w / 2+1.0, 0.4, l)
        glVertex3f(-w / 2-1.0, 0.4, l)
        glEnd()  
        shaders.disable()
Esempio n. 8
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)
Esempio n. 9
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)