[PB5.00 b5] Aéroglisseur + terrain + physique

Généralités sur la programmation 3D
kelebrindae
Messages : 579
Inscription : ven. 11/mai/2007 15:21

[PB5.00 b5] Aéroglisseur + terrain + physique

Message par kelebrindae »

Salut tout le monde!

Pour tester un peu la v5.00, je me suis fait ce petit test. Il s'agit d'un petit aéroglisseur à déplacer sur un terrain, avec gestion de la physique.

C'est là que je me rends compte que je ne suis pas très bon, avec la physique. :mrgreen:

Bon, ça marche, ça pourrait suffire pour un petit jeu d'arcade, mais c'est loin d'être parfait.
En fait, le principal truc qui me chiffonne, c'est que je n'ai pas réussi à déterminer avec précision quand le vaisseau touche le sol => sur les pentes élevées, le contact n'est pas détecté et le vaisseau ne s'adapte plus à l'angle du terrain (je n'arrive pas à m'expliquer clairement; voyez par vous-même).

Merci à tout ceux à qui j'ai chipé des bouts de code (Comtois, principalement). Par ailleurs, je suis ouvert à toute amélioration, alors n'hésitez pas :wink: !

[EDIT] grosse mise à jour: des arbres, des adversaires, et des checkpoints auxquels il faut arriver avant les adversaires!
Prenez le zip (il y a pleins de fichiers en plus), et surtout effacez le "fichier cache du terrain" (hovercraft_00000000.dat, dans le répertoire "meshes") parce que ce n'est plus le même.

[EDIT] Possibilité d'avoir plus de 3 adversaires. Ils sont réparties entre les trois équipes adverses et vous êtes seul contre tous... :mrgreen:

Code + médias: http://keleb.free.fr/codecorner/downloa ... rcraft.zip

Code : Tout sélectionner

;************************************************************************************
;  Hovercraft race (inspired by the Binary Moon tutorials for DarkBasic)
;  PB version: 5.00 b6
;  Date: October, 23, 2012
;- F1 -> Change camera view
;- F2 -> Change camera target
;- F5 : Display physic body
;- F6 : Wireframe mode
;************************************************************************************

;************************************************************************************
;-                          ---- Constants and structure ----
;************************************************************************************

#NUMTERRAIN = 0
#TerrainMiniX = 0
#TerrainMiniY = 0
#TerrainMaxiX = 0
#TerrainMaxiY = 0

#CAMERA = 0
#NB_HOVERCRAFT = 6    ; Nb hovercrafts (except you)
#NB_TEAMS = 3         ; Nb teams (except yours)
#NB_CRATESTACKS = 20
#NB_TREES = 100
Enumeration
  #RearView
  #SideView
  #FrontView
  #TopView
  
  #END_VIEWLIST
EndEnumeration


Structure hover_struct
  node.i
  frontNode.i
  backNode.i
  leftNode.i
  rightNode.i
  cameraNode.i
  
  hovercraftMesh.i
  hovercraftEntity.i
  
  physicsEntity.i
  physicsMesh.i
  mass.f
  restitution.f
  friction.f
  
  radius.f
  centerHeight.f
    
  thrust.f
EndStructure
Global Dim hovercraft.hover_struct(#NB_HOVERCRAFT+1)

Structure checkpoint_struct
  node.i
  
  x.f
  y.f
  z.f
  
  radius.f
EndStructure
Global currentCheckpoint.checkpoint_struct

Global Dim treeMesh.i(4)

Global Dim scoreSprite.i(4)
Global Dim score.i(4)
Global Dim scoreColor.i(4)
scoreColor(0) = $0000FF
scoreColor(1) = $FF0000
scoreColor(2) = $00FF00
scoreColor(3) = $00FFFF
Global Dim nomMatAi.s(4)
nomMatAi(0) = "hoverblue"
nomMatAi(1) = "hovergreen"
nomMatAi(2) = "hoveryellow"
Global arrowMesh.i,arrowEntity.i

EnableExplicit

;************************************************************************************
;-                                 ---- Macros ----
;************************************************************************************

; Les deux macros ci-dessous sont de Comtois. Merci Comtois !
Macro NEWXVALUE(x, Angle, Distance)
  ((x) + Cos(Radian(Angle+90)) * (Distance))
EndMacro

Macro NEWZVALUE(z, Angle, Distance)
  ((z) - Sin(Radian(Angle+90)) * (Distance))
EndMacro

Macro ANGLE2CHECKPOINT(idHovercraft)
  Degree(ATan2(NodeZ(hovercraft(idHovercraft)\node) - currentCheckpoint\z , NodeX(hovercraft(idHovercraft)\node) - currentCheckpoint\x ))
EndMacro

;************************************************************************************
;-                                 ---- Procedures ----
;************************************************************************************

; Gestion des blendmaps du terrain, par Comtois 
Procedure Clamp(*var.float, min.f, max.f)
  If *var\f < min
    *var\f = min
  ElseIf *var\f > max
    *var\f = max
  EndIf
EndProcedure

Procedure InitBlendMaps()
  Protected minHeight1.f,fadeDist1.f,minHeight2.f,fadeDist2.f
  Protected x.i,y.i,tx.i,ty.i,size.i
  Protected height.f, val.f
  
  minHeight1 = 0
  fadeDist1 = 15
  minHeight2 = 25
  fadeDist2 = 15
  
  For ty = #TerrainMiniY To #TerrainMaxiY
    For tx = #TerrainMiniX To #TerrainMaxiX
      Size = TerrainTileLayerMapSize(#NUMTERRAIN, tx, ty)
      For y = 0 To Size-1
        For x = 0 To Size-1
          Height = TerrainTileHeightAtPosition(#NUMTERRAIN, tx, ty, 1, x, y)
          
          val = (Height - minHeight1) / fadeDist1
          Clamp(@val, 0, 1)
          SetTerrainTileLayerBlend(#NUMTERRAIN, tx, ty, 1, x, y, val)
          
          val = (Height - minHeight2) / fadeDist2
          Clamp(@val, 0, 1)
          SetTerrainTileLayerBlend(#NUMTERRAIN, tx, ty, 2, x, y, val)
        Next
      Next
      UpdateTerrainTileLayerBlend(#NUMTERRAIN, tx, ty, 1)
      UpdateTerrainTileLayerBlend(#NUMTERRAIN, tx, ty, 2)
    Next
  Next  
EndProcedure  

; ************** end of terrain procs *************


; Keep angle in the 0-360 range
Procedure.f wrapValue(angle.f)
  If angle < 0
    angle + 360
  ElseIf angle >=360
    angle-360
  EndIf

  ProcedureReturn angle
EndProcedure

; La procédure ci-dessous est de Comtois. Merci Comtois !
; Calcule une valeur progressive allant de la valeur actuelle à la valeur cible
Procedure.f curveValue(actuelle.f, Cible.f, P.f)
  If P > 1000.0
    P = 1000.0
  EndIf
  ProcedureReturn (actuelle + ( (Cible - actuelle) * P / 1000.0))
EndProcedure


Procedure createTrees(nbTrees.i)
  Protected i.i,tree.i,numMesh.i
  Protected posX.f,posY.f,posZ.f
  
  treeMesh(0) = LoadMesh(#PB_Any,"arbol_mort.mesh")
  treeMesh(1) = LoadMesh(#PB_Any,"arbol_sec.mesh")
  treeMesh(2) = LoadMesh(#PB_Any,"arbol.mesh")
  treeMesh(3) = LoadMesh(#PB_Any,"sapin.mesh")
  BuildMeshShadowVolume(treeMesh(0))
  BuildMeshShadowVolume(treeMesh(1))
  BuildMeshShadowVolume(treeMesh(2))
  BuildMeshShadowVolume(treeMesh(3))
  
  For i= 1 To nbTrees
    posX = Random(900) - 450
    posZ = Random(900) - 450
    posY = TerrainHeight(#NUMTERRAIN,posX,posZ)-0.2
    numMesh = Round(posY / 10, #PB_Round_Down)
    Clamp(@numMesh,0,3)
    If numMesh > 3
      numMesh = 3
    EndIf
    
    tree = CreateEntity(#PB_Any,MeshID(treeMesh(numMesh)),#PB_Material_None,posX,posY,posZ)
    RotateEntity(tree,-90,Random(360),0)
    ScaleEntity(tree,(70 + Random(60))/100.0,(70 + Random(60))/100.0,(70 + Random(60))/100.0)
    EntityRenderMode(tree,#PB_Entity_CastShadow)
    EntityPhysicBody(tree,#PB_Entity_StaticBody,99,1.0,1.0)
  
  Next i
  
EndProcedure

Procedure createCrates(nbStacks.i)
  Protected i.i,j.i,temp.i
  Protected cubeMesh.i,txCrate.i,mtCrate.i
  Protected oriX.f,oriZ.f,posX.f,posY,posZ.f
  
  cubeMesh = CreateCube(#PB_Any,1)
  txCrate = LoadTexture(#PB_Any,"crate.png")
  mtCrate = CreateMaterial(#PB_Any,TextureID(txCrate))
  
  For j=1 To nbStacks
    posX = Random(900) - 450
    oriZ = Random(900) - 450
    For i = 1 To 3
      temp = CreateEntity(#PB_Any, MeshID(cubeMesh), MaterialID(mtCrate))
      posZ = oriZ + (i*1.1)
      EntityLocate(temp,posX,TerrainHeight(#NUMTERRAIN,posX,posZ)+0.5,posZ)
      EntityPhysicBody(temp, #PB_Entity_BoxBody, 0.25)
    Next i
    For i = 1 To 2
      temp = CreateEntity(#PB_Any, MeshID(cubeMesh), MaterialID(mtCrate))
      posZ = oriZ + 0.5 + (i*1.1)
      EntityLocate(temp,posX,TerrainHeight(#NUMTERRAIN,posX,posZ)+1.5,posZ)
      EntityPhysicBody(temp, #PB_Entity_BoxBody, 0.25)
    Next i
    
    temp = CreateEntity(#PB_Any, MeshID(cubeMesh), MaterialID(mtCrate))
    posZ = oriZ + 1 + 1.1
    EntityLocate(temp,posX,TerrainHeight(#NUMTERRAIN,posX,posZ)+2.5,posZ)
    EntityPhysicBody(temp, #PB_Entity_BoxBody, 0.25)
    
  Next j
  
EndProcedure

; Créer un hovercraft et initialise ses paramètres: position, friction, hauteur de son pivot, accélération...
Procedure createHovercraft(id.i,nomMesh.s,posX.f, posZ.f, mass.f, restitution.f, friction.f, thrust.f, centerHeight.f)
  Protected numMat.i
  
  ; Material
  If id = 0
    numMat = GetScriptMaterial(#PB_Any,"hoverred")
  Else
    numMat = GetScriptMaterial(#PB_Any,nomMatAi((id-1) % #NB_TEAMS))
  EndIf
  
  ; Hovercraft entity
  hovercraft(id)\hovercraftMesh = LoadMesh(#PB_Any,"hovercraft.mesh")  
  hovercraft(id)\hovercraftEntity = CreateEntity(#PB_Any,MeshID(hovercraft(id)\hovercraftMesh),MaterialID(numMat))
  EntityRenderMode(hovercraft(id)\hovercraftEntity,#PB_Entity_CastShadow)
  EntityPhysicBody(hovercraft(id)\hovercraftEntity,#PB_Entity_None)
  
  ; Hovercraft parameters
  hovercraft(id)\thrust = thrust
  hovercraft(id)\radius = MeshRadius(hovercraft(id)\hovercraftMesh)*1.33
  hovercraft(id)\centerHeight = centerHeight
  hovercraft(id)\mass = mass
  hovercraft(id)\restitution = restitution
  hovercraft(id)\friction = friction
  
  ; Main node
  hovercraft(id)\node = CreateNode(#PB_Any)
  AttachNodeObject(hovercraft(id)\node,EntityID(hovercraft(id)\hovercraftEntity))
  
  ; These nodes are used to get terrain height at different points of the hovercraft, according to its rotation
  hovercraft(id)\frontNode = CreateNode(#PB_Any,0,0,-hovercraft(id)\radius)
  hovercraft(id)\backNode = CreateNode(#PB_Any,0,0,hovercraft(id)\radius)
  hovercraft(id)\leftNode = CreateNode(#PB_Any,-hovercraft(id)\radius,0,0)
  hovercraft(id)\rightNode = CreateNode(#PB_Any,hovercraft(id)\radius,0,0)
  
  AttachNodeObject(hovercraft(id)\node,NodeID(hovercraft(id)\frontNode))
  AttachNodeObject(hovercraft(id)\node,NodeID(hovercraft(id)\backNode))
  AttachNodeObject(hovercraft(id)\node,NodeID(hovercraft(id)\leftNode))
  AttachNodeObject(hovercraft(id)\node,NodeID(hovercraft(id)\rightNode))
  
  ; Camera Node
  hovercraft(id)\cameraNode = CreateNode(#PB_Any,0,1,5)
  AttachNodeObject(hovercraft(id)\node,NodeID(hovercraft(id)\cameraNode))
  
  ; Physics entity for the hovercraft
  hovercraft(id)\physicsMesh = CreateSphere(#PB_Any,hovercraft(id)\radius * 0.8)
  hovercraft(id)\physicsEntity = CreateEntity(#PB_Any,MeshID(hovercraft(id)\physicsMesh),MaterialID(999),posX,TerrainHeight(#NUMTERRAIN,posX,posZ)+1,posZ)
  EntityRenderMode(hovercraft(id)\physicsEntity,0)
  EntityPhysicBody(hovercraft(id)\physicsEntity,#PB_Entity_SphereBody,hovercraft(id)\mass,hovercraft(id)\restitution,hovercraft(id)\friction)
  HideEntity(hovercraft(id)\physicsEntity,#True)
  
EndProcedure


; Apply thrust and steering, and reposition the hovercraft
Procedure moveHovercraft(id.i ,forward.i, backward.i, left.i, right.i)
  Protected xPos.f, yPos.f, zPos.f
  Protected frontHeight.f,backHeight.f,leftHeight.f,rightHeight.f
  Protected xAng.f,yAng.f, zAng.f
  Protected xSlide.f,zSlide.f
  Protected thrustAngle.f, thrust.f
  
  ; Position the hovercraft and get its yaw
  xPos = EntityX(hovercraft(id)\physicsEntity)
  yPos = EntityY(hovercraft(id)\physicsEntity) - hovercraft(id)\radius
  zPos = EntityZ(hovercraft(id)\physicsEntity)
  yAng = NodeYaw(hovercraft(id)\node)
  
  ; The hovercraft can rotate left/right, even in the air
  If left = #True
    RotateNode(hovercraft(id)\node,0,wrapvalue(yAng+4),0)
  ElseIf right = #True
    RotateNode(hovercraft(id)\node,0,wrapvalue(yAng-4),0)
  EndIf
  
  ; If the player is on ground:
  ;   - its rotation must change according to terrain slope;
  ;   - it can accelerate / deccelerate;
  ClearDebugOutput()
  If yPos < TerrainHeight(#NUMTERRAIN,xPos,zPos)

    ; Friction
    ; J'aimerais bien que la friction soit plus importante, mais avec un body "Sphere", on ne peut pas (?)
     
    ; Put the hovercraft on the ground
    yPos = TerrainHeight(#NUMTERRAIN,xPos,zPos)
  
    ; Positions of the front, back, left and right nodes
    frontHeight = TerrainHeight(#NUMTERRAIN,NodeX(hovercraft(id)\frontNode),NodeZ(hovercraft(id)\frontNode))
    backHeight  = TerrainHeight(#NUMTERRAIN,NodeX(hovercraft(id)\backNode),NodeZ(hovercraft(id)\backNode))
    leftHeight  = TerrainHeight(#NUMTERRAIN,NodeX(hovercraft(id)\leftNode),NodeZ(hovercraft(id)\leftNode))
    rightHeight = TerrainHeight(#NUMTERRAIN,NodeX(hovercraft(id)\rightNode),NodeZ(hovercraft(id)\rightNode))
    
    ; Quick hack to estimate hovercraft's angle
    xAng = (frontHeight - backHeight) * 30
    zAng = (rightHeight - leftHeight) * 30
    
    ; Update the vehicle rotation
    RotateEntity(hovercraft(id)\hovercraftEntity,xAng,0,0,#PB_Absolute)
    RotateEntity(hovercraft(id)\hovercraftEntity,0,0,zAng,#PB_Relative)
  
    ; apply forward/backward movement
    If forward = #True
      thrustAngle = 270 - NodeYaw(hovercraft(id)\node)
      thrust = hovercraft(id)\thrust
    ElseIf backward = #True
      thrustAngle = 270 - NodeYaw(hovercraft(id)\node)
      thrust = -hovercraft(id)\thrust
    EndIf
    
    ; Adjust thrust according to front/back angle
    thrust * (1 - (xAng/30))
    ;Debug StrF(xpos,2)+" , "+StrF(zpos,2)
    ;Debug "Angle = " + StrF(xAng,2) + "° | Thrust factor = " + StrF((1 - (xAng/30)),2)
        
    ; Move the hovercraft
    DisableEntityBody(hovercraft(id)\physicsEntity,#False)
    ApplyEntityForce(hovercraft(id)\physicsEntity,thrust * Cos(Radian(thrustAngle)),0,thrust * Sin(Radian(thrustAngle)) )
    SetEntityAttribute(hovercraft(id)\physicsEntity, #PB_Entity_MaxVelocity, hovercraft(id)\thrust)
  EndIf
  
  ; Reposition the player object
  NodeLocate(hovercraft(id)\node,xPos,yPos + hovercraft(id)\centerHeight,zPos)
  
;   xang = Degree(ATan2(NodeZ(hovercraft(id)\node) - currentCheckpoint\z , NodeX(hovercraft(id)\node) - currentCheckpoint\x )    )
;   Debug wrapValue(xang - NodeYaw(hovercraft(id)\node))
  
EndProcedure


Procedure moveAiHovercraft()
  Protected id.i
  Protected forward.b = #True, backward.b, left.b, right.b
  Protected angle.f
  
  For id = 1 To #NB_HOVERCRAFT
    
    If wrapValue(ANGLE2CHECKPOINT(id) - NodeYaw(hovercraft(id)\node)) < 180
      left=#True
      right=#False
    Else
      left=#False
      right=#True
    EndIf
    
    moveHovercraft(id,forward,backward,left,right)
  Next id
  
EndProcedure


Procedure manageCheckpoint(*ptrCheckPoint.checkpoint_struct)
  Protected x.f = *ptrCheckPoint\x + *ptrCheckPoint\radius * Cos(Radian(ElapsedMilliseconds()*2))
  Protected z.f = *ptrCheckPoint\z + *ptrCheckPoint\radius * Sin(Radian(ElapsedMilliseconds()*2))
  Protected i.i, team.i
  
  NodeLocate(*ptrCheckPoint\node,x,TerrainHeight(#NUMTERRAIN,x,z)+ *ptrCheckPoint\y,z)
  
  ; If an hovercraft reach the checkpoint, change its position
  For i=0 To #NB_HOVERCRAFT
    If (*ptrCheckPoint\x - NodeX(hovercraft(i)\node)) * (*ptrCheckPoint\x - NodeX(hovercraft(i)\node)) + (*ptrCheckPoint\z - NodeZ(hovercraft(i)\node)) * (*ptrCheckPoint\z - NodeZ(hovercraft(i)\node)) < *ptrCheckPoint\radius * *ptrCheckPoint\radius
      *ptrCheckPoint\x = Random(900) - 450
      *ptrCheckPoint\z = Random(900) - 450
      
      If i > 0
        team = 1 + ((i-1) % #NB_TEAMS)
      EndIf
      score(team) + 10
      StartDrawing(SpriteOutput(scoreSprite(team)))
      Box(0,0,20,20,scoreColor(team))
      DrawText(32,2,RSet(Str(score(team)),3,"0"))
      StopDrawing()

    EndIf  
  Next i
  
EndProcedure

; Position the camera
Procedure manageCamera(mode.i,id.i)
  Protected Px.f, Py.f, Pz.f
  Static cameraAngle.f

  Select Mode

    Case #FrontView
      cameraAngle = CurveValue(cameraAngle, NodeYaw(hovercraft(id)\node), 100)
      Px = CurveValue(CameraX(#CAMERA), NEWXVALUE(NodeX(hovercraft(id)\node), cameraAngle, 6), 100)
      Py = CurveValue(CameraY(#CAMERA), NodeY(hovercraft(id)\node) + 3, 100)
      Pz = CurveValue(CameraZ(#CAMERA), NEWZVALUE(NodeZ(hovercraft(id)\node), cameraAngle, 6), 100)

    Case #TopView
      cameraAngle = CurveValue(cameraAngle, NodeYaw(hovercraft(id)\node) + 180, 100)
      Px = CurveValue(CameraX(#CAMERA), NEWXVALUE(NodeX(hovercraft(id)\node), cameraAngle, 4), 30)
      Py = CurveValue(CameraY(#CAMERA), NodeY(hovercraft(id)\node) + 100, 30)
      Pz = CurveValue(CameraZ(#CAMERA), NEWZVALUE(NodeZ(hovercraft(id)\node), cameraAngle, 4), 30)

    Case #RearView
      cameraAngle = CurveValue(cameraAngle, NodeYaw(hovercraft(id)\node) + 180, 100)
      Px = CurveValue(CameraX(#CAMERA), NodeX(hovercraft(id)\cameraNode), 100)
      Pz = CurveValue(CameraZ(#CAMERA), NodeZ(hovercraft(id)\cameraNode), 100)
      Py = CurveValue(CameraY(#CAMERA), NodeY(hovercraft(id)\node) + 1, 100)
      If Py < TerrainHeight(#NUMTERRAIN,Px,Pz) + 1
        Py = TerrainHeight(#NUMTERRAIN,Px,Pz) + 1
      EndIf
     
    Case #SideView
      cameraAngle = CurveValue(cameraAngle, NodeYaw(hovercraft(id)\node) + 90, 100)
      Px = CurveValue(CameraX(#CAMERA), NEWXVALUE(NodeX(hovercraft(id)\node), cameraAngle, 8), 100)
      Py = CurveValue(CameraY(#CAMERA), NodeY(hovercraft(id)\node) + 4, 100)
      Pz = CurveValue(CameraZ(#CAMERA), NEWZVALUE(NodeZ(hovercraft(id)\node), cameraAngle, 8), 100)

  EndSelect
  
  CameraLocate(#CAMERA, Px, Py, Pz)
  CameraLookAt(#CAMERA, NodeX(hovercraft(id)\node), NodeY(hovercraft(id)\node), NodeZ(hovercraft(id)\node))
  
EndProcedure

DisableExplicit


;************************************************************************************
;-                                 ---- Main program ----
;************************************************************************************

If InitEngine3D() = 0
  MessageRequester( "Error" , "Can't initialize 3D, check if engine3D.dll is available" , 0 )
End
ElseIf InitSprite() = 0 Or InitKeyboard() = 0 Or InitMouse() = 0
  MessageRequester( "Error" , "Can't find DirectX 7.0 or above" , 0 )
  End
EndIf

OpenWindow(0,0, 0, 800 , 500 ,"Hovercraft")
OpenWindowedScreen(WindowID(0),0,0, 800, 500,0,0,0,#PB_Screen_SmartSynchronization)

;- 3d archives
Add3DArchive("meshes/", #PB_3DArchive_FileSystem)
Add3DArchive("materials/", #PB_3DArchive_FileSystem)
Add3DArchive("textures/", #PB_3DArchive_FileSystem)
Add3DArchive("medias/", #PB_3DArchive_FileSystem)
Parse3DScripts()  

;- Lighting
light = CreateLight(#PB_Any ,$FFFFFF, 500, 1000, 500,#PB_Light_Directional)
LightColor(light, $555555, #PB_Light_SpecularColor)
LightDirection(light, 0.55, -0.5, -0.75)
AmbientColor($222222)
; light = CreateLight(#PB_Any ,$FFFFFF, 500, 750, 500)
; AmbientColor($333333)
WorldShadows(#PB_Shadow_Modulative)
Fog($C2AF80,20,10,1000)

;- Camera 
CreateCamera(#CAMERA, 0, 0, 100, 100)
CameraBackColor(#CAMERA,$FF7755)

; Arrow
arrowMesh = LoadMesh(#PB_Any,"arrow.mesh")
arrowEntity = CreateEntity(#PB_Any,MeshID(arrowMesh),#PB_Material_None)
ScaleEntity(arrowEntity,0.5,0.5,0.5)


;- Terrain definition
SetupTerrains(LightID(light), 3000, #PB_Terrain_NormalMapping)
CreateTerrain(#NUMTERRAIN, 1025, 1000, 50, 3, "hovercraft", "dat")
AddTerrainTexture(#NUMTERRAIN,  0, 10, "sand.jpg", "sand_n.jpg")
AddTerrainTexture(#NUMTERRAIN,  1,  20, "grass.jpg", "grass_n.jpg")
AddTerrainTexture(#NUMTERRAIN,  2, 30, "rock.jpg",  "rock_n.jpg")

; Build terrains
For ty = #TerrainMiniY To #TerrainMaxiY
  For tx = #TerrainMiniX To #TerrainMaxiX
    imported = DefineTerrainTile(#NUMTERRAIN, tx, ty, "heightmap_2.png", ty % 2, tx % 2)  
  Next
Next  
BuildTerrain(#NUMTERRAIN)
TerrainPhysicBody(#NUMTERRAIN,0.1,2.0)

If imported = #True
  InitBlendMaps() 
  UpdateTerrain(#NUMTERRAIN)
  SaveTerrain(#NUMTERRAIN, #False)
EndIf  

;- Wireframe material 
; (used To display the hovercraft's physics entity)
CreateTexture(999,16,16)
StartDrawing(TextureOutput(999))
Box(0,0,16,16,$FFFF00)
StopDrawing()
CreateMaterial(999,TextureID(999))
DisableMaterialLighting(999, State)
MaterialShadingMode(999, #PB_Material_Wireframe)


;- Hovercrafts
createHovercraft(0,"hovercraft.mesh",0,150,1,0.1,2.0,15,0.4)     ; player
numLine = 0
For i=1 To #NB_HOVERCRAFT
  ; Put them in lines of 20
  If i % 20 = 0
    numLine  + 1
  EndIf
  
  ; One to the left, one to the right
  If i % 2 = 0
    posX = (-(i - numLine *20) * 5)
  Else
    posX = ((i - numLine *20) * 5)
  EndIf
  
  createHovercraft(i,"hovercraft.mesh",posX,160 + numLine * 10,1,0.1,2.0,14.5,0.4)  ; opponents (slightly slower)
Next i

;- Crates
cubeMesh = CreateCube(#PB_Any,1)
createCrates(#NB_CRATESTACKS)

;- Trees
createTrees(#NB_TREES)

;- Checkpoint
ringsParticle = GetScriptParticleEmitter(#PB_Any,"flareFountain")
currentCheckpoint\x = 0
currentCheckpoint\z = 0
currentCheckpoint\radius = 3
currentCheckpoint\node = CreateNode(#PB_Any)
AttachNodeObject(currentCheckpoint\node,ParticleEmitterID(ringsParticle))

; Score sprites
For i = 0 To #NB_TEAMS
  scoreSprite(i) = CreateSprite(#PB_Any,64,20)
  StartDrawing(SpriteOutput(scoreSprite(i)))
  Box(0,0,20,20,scoreColor(i))
  DrawText(32,2,"000")
  DrawingMode(#PB_2DDrawing_Outlined)
  Box(0,0,64,20,scoreColor(i))  
  StopDrawing()
Next i

;- Main loop
hidePhysicBody = #True
wireframe = #False
cameraMode = #rearView
Repeat
  While WindowEvent()
  Wend

  forward = #False:backward=#False:left=#False:right=#False
  If ExamineKeyboard()
    If KeyboardPushed(#PB_Key_Up)
      forward = #True
    ElseIf KeyboardPushed(#PB_Key_Down)
      backward=#True
    EndIf    
    If KeyboardPushed(#PB_Key_Left)
      left = #True
    ElseIf KeyboardPushed(#PB_Key_Right)
      right=#True
    EndIf
  
    ;Change camera view
    If KeyboardReleased(#PB_Key_F1)
      cameraMode = (cameraMode + 1) % #END_VIEWLIST
    EndIf
    
    If KeyboardReleased(#PB_Key_F2)
      cameraTarget = (cameraTarget + 1) % (#NB_HOVERCRAFT + 1)
    EndIf
    
    ; Display physic body
    If KeyboardReleased(#PB_Key_F5)
      hidePhysicBody = 1 - hidePhysicBody
      HideEntity(hovercraft(0)\physicsEntity, hidePhysicBody)
    EndIf
    ; Display physic body
    If KeyboardReleased(#PB_Key_F6)
      wireframe = 1 - wireframe
      If wireframe = #True
        CameraRenderMode(#CAMERA,#PB_Camera_Wireframe)
      Else
        CameraRenderMode(#CAMERA,#PB_Camera_Textured)
      EndIf
    EndIf

  EndIf
  
  ;- Checkpoints
  manageCheckpoint(@currentCheckpoint)
  
  ;- Move the hovercrafts
  moveHovercraft(0,forward,backward,left,right)
  moveAiHovercraft()
  
  ;- Move the camera
  ManageCamera(cameraMode,cameraTarget)
  
  ;- Hud
  MoveCamera(#CAMERA,0,1.60,-5)
  EntityLocate(arrowEntity,CameraX(#CAMERA),CameraY(#CAMERA),CameraZ(#CAMERA))
  RotateEntity(arrowEntity,30,ANGLE2CHECKPOINT(cameraTarget),0)
  MoveCamera(#CAMERA,0,-1.60,5)
  
  RenderWorld()
  
  ;- Scores
  For i = 0 To #NB_TEAMS
    DisplayTransparentSprite(scoreSprite(i),i*80,8)
  Next i
  
  FlipBuffers()
Until KeyboardPushed(#PB_Key_Escape)
Dernière modification par kelebrindae le mer. 24/oct./2012 17:34, modifié 3 fois.
Les idées sont le souvenir de choses qui ne se sont pas encore produites.
Avatar de l’utilisateur
djes
Messages : 4252
Inscription : ven. 11/févr./2005 17:34
Localisation : Arras, France

Re: [PB5.00 b5] Aéroglisseur + terrain + physique

Message par djes »

Ici je suis obligé de désactiver les ombres (bug connu sinon plantage), le fond est bleu, je n'ai pas de décor, juste la vue de l'aéroglisseur.
kelebrindae
Messages : 579
Inscription : ven. 11/mai/2007 15:21

Re: [PB5.00 b5] Aéroglisseur + terrain + physique

Message par kelebrindae »

Euh ?! 8O

Es-tu bien en PB 5.00 b5 ? Tu as bien tous les médias ?
Ici, ça fonctionne sans souci (même les ombres) en x86 / DirectX.
Essaie de désactiver le fog, à tout hasard. Sinon, je ne vois pas...

Image
Les idées sont le souvenir de choses qui ne se sont pas encore produites.
Avatar de l’utilisateur
djes
Messages : 4252
Inscription : ven. 11/févr./2005 17:34
Localisation : Arras, France

Re: [PB5.00 b5] Aéroglisseur + terrain + physique

Message par djes »

Image

ogre.log en OpenGL (ombres activées)
15:50:50: Creating resource group General
15:50:50: Creating resource group Internal
15:50:50: Creating resource group Autodetect
15:50:50: SceneManagerFactory for type 'DefaultSceneManager' registered.
15:50:50: Registering ResourceManager for type Material
15:50:50: Registering ResourceManager for type Mesh
15:50:50: Registering ResourceManager for type Skeleton
15:50:50: MovableObjectFactory for type 'ParticleSystem' registered.
15:50:50: OverlayElementFactory for type Panel registered.
15:50:50: OverlayElementFactory for type BorderPanel registered.
15:50:50: OverlayElementFactory for type TextArea registered.
15:50:50: Registering ResourceManager for type Font
15:50:50: ArchiveFactory for archive type FileSystem registered.
15:50:50: ArchiveFactory for archive type Zip registered.
15:50:50: ArchiveFactory for archive type EmbeddedZip registered.
15:50:50: DDS codec registering
15:50:50: FreeImage version: 3.10.0
15:50:50: This program uses FreeImage, a free, open source image library supporting all common bitmap formats. See http://freeimage.sourceforge.net for details
15:50:50: Supported formats: bmp,ico,jpg,jif,jpeg,jpe,koa,iff,lbm,pbm,pbm,pcd,pcx,pgm,pgm,png,ppm,ppm,ras,tga,targa,tif,tiff,wap,wbmp,wbm,psd,cut,xbm,xpm,dds,gif,g3,sgi,j2k,j2c,jp2
15:50:50: PVRTC codec registering
15:50:50: Registering ResourceManager for type HighLevelGpuProgram
15:50:50: Registering ResourceManager for type Compositor
15:50:50: MovableObjectFactory for type 'Entity' registered.
15:50:50: MovableObjectFactory for type 'Light' registered.
15:50:50: MovableObjectFactory for type 'BillboardSet' registered.
15:50:50: MovableObjectFactory for type 'ManualObject' registered.
15:50:50: MovableObjectFactory for type 'BillboardChain' registered.
15:50:50: MovableObjectFactory for type 'RibbonTrail' registered.
15:50:50: *-*-* OGRE Initialising
15:50:50: *-*-* Version 1.8.0 (Byatis)
15:50:50: D3D9 : Direct3D9 Rendering Subsystem created.
15:50:50: D3D9: Driver Detection Starts
15:50:50: D3D9: Driver Detection Ends
15:50:50: OpenGL Rendering Subsystem created.
15:50:51: Particle Emitter Type 'Point' registered
15:50:51: Particle Emitter Type 'Box' registered
15:50:51: Particle Emitter Type 'Ellipsoid' registered
15:50:51: Particle Emitter Type 'Cylinder' registered
15:50:51: Particle Emitter Type 'Ring' registered
15:50:51: Particle Emitter Type 'HollowEllipsoid' registered
15:50:51: Particle Affector Type 'LinearForce' registered
15:50:51: Particle Affector Type 'ColourFader' registered
15:50:51: Particle Affector Type 'ColourFader2' registered
15:50:51: Particle Affector Type 'ColourImage' registered
15:50:51: Particle Affector Type 'ColourInterpolator' registered
15:50:51: Particle Affector Type 'Scaler' registered
15:50:51: Particle Affector Type 'Rotator' registered
15:50:51: Particle Affector Type 'DirectionRandomiser' registered
15:50:51: Particle Affector Type 'DeflectorPlane' registered
15:50:51: PCZone Factory Type 'ZoneType_Default' registered
15:50:51: CPU Identifier & Features
15:50:51: -------------------------
15:50:51: * CPU ID: GenuineIntel: Intel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHz
15:50:51: * SSE: yes
15:50:51: * SSE2: yes
15:50:51: * SSE3: yes
15:50:51: * MMX: yes
15:50:51: * MMXEXT: yes
15:50:51: * 3DNOW: no
15:50:51: * 3DNOWEXT: no
15:50:51: * CMOV: yes
15:50:51: * TSC: yes
15:50:51: * FPU: yes
15:50:51: * PRO: yes
15:50:51: * HT: no
15:50:51: -------------------------
15:50:51: *** Starting Win32GL Subsystem ***
15:50:51: Registering ResourceManager for type Texture
15:50:51: SceneManagerFactory for type 'OctreeSceneManager' registered.
15:50:51: SceneManagerFactory for type 'BspSceneManager' registered.
15:50:51: Registering ResourceManager for type BspLevel
15:50:51: GLRenderSystem::_createRenderWindow "PureBasic Ogre", 800x500 windowed miscParams: FSAA=0 displayFrequency=0 externalWindowHandle=70944 vsync=true
15:50:51: GL_VERSION = 3.3.11653 Compatibility Profile Context
15:50:51: GL_VENDOR = ATI Technologies Inc.
15:50:51: GL_RENDERER = ATI Radeon HD 4600 Series
15:50:51: GL_EXTENSIONS = GL_AMDX_debug_output GL_AMDX_vertex_shader_tessellator GL_AMD_conservative_depth GL_AMD_debug_output GL_AMD_depth_clamp_separate GL_AMD_draw_buffers_blend GL_AMD_name_gen_delete GL_AMD_performance_monitor GL_AMD_pinned_memory GL_AMD_sample_positions GL_AMD_seamless_cubemap_per_texture GL_AMD_shader_stencil_export GL_AMD_texture_cube_map_array GL_AMD_texture_texture4 GL_AMD_vertex_shader_tessellator GL_ARB_ES2_compatibility GL_ARB_base_instance GL_ARB_blend_func_extended GL_ARB_color_buffer_float GL_ARB_compressed_texture_pixel_storage GL_ARB_conservative_depth GL_ARB_copy_buffer GL_ARB_depth_buffer_float GL_ARB_depth_clamp GL_ARB_depth_texture GL_ARB_draw_buffers GL_ARB_draw_buffers_blend GL_ARB_draw_elements_base_vertex GL_ARB_draw_instanced GL_ARB_explicit_attrib_location GL_ARB_fragment_coord_conventions GL_ARB_fragment_program GL_ARB_fragment_program_shadow GL_ARB_fragment_shader GL_ARB_framebuffer_object GL_ARB_framebuffer_sRGB GL_ARB_geometry_shader4 GL_ARB_get_program_binary GL_ARB_half_float_pixel GL_ARB_half_float_vertex GL_ARB_imaging GL_ARB_instanced_arrays GL_ARB_internalformat_query GL_ARB_map_buffer_alignment GL_ARB_map_buffer_range GL_ARB_multisample GL_ARB_multitexture GL_ARB_occlusion_query GL_ARB_occlusion_query2 GL_ARB_pixel_buffer_object GL_ARB_point_parameters GL_ARB_point_sprite GL_ARB_provoking_vertex GL_ARB_sample_shading GL_ARB_sampler_objects GL_ARB_seamless_cube_map GL_ARB_separate_shader_objects GL_ARB_shader_bit_encoding GL_ARB_shader_objects GL_ARB_shader_precision GL_ARB_shader_stencil_export GL_ARB_shader_texture_lod GL_ARB_shading_language_100 GL_ARB_shading_language_420pack GL_ARB_shading_language_packing GL_ARB_shadow GL_ARB_shadow_ambient GL_ARB_sync GL_ARB_texture_border_clamp GL_ARB_texture_buffer_object GL_ARB_texture_buffer_object_rgb32 GL_ARB_texture_compression GL_ARB_texture_compression_rgtc GL_ARB_texture_cube_map GL_ARB_texture_cube_map_array GL_ARB_texture_env_add GL_ARB_texture_env_combine GL_ARB_texture_env_crossbar GL_ARB_texture_env_dot3 GL_ARB_texture_float GL_ARB_texture_gather GL_ARB_texture_mirrored_repeat GL_ARB_texture_multisample GL_ARB_texture_non_power_of_two GL_ARB_texture_query_lod GL_ARB_texture_rectangle GL_ARB_texture_rg GL_ARB_texture_rgb10_a2ui GL_ARB_texture_snorm GL_ARB_texture_storage GL_ARB_timer_query GL_ARB_transform_feedback2 GL_ARB_transform_feedback3 GL_ARB_transform_feedback_instanced GL_ARB_transpose_matrix GL_ARB_uniform_buffer_object GL_ARB_vertex_array_bgra GL_ARB_vertex_array_object GL_ARB_vertex_buffer_object GL_ARB_vertex_program GL_ARB_vertex_shader GL_ARB_vertex_type_2_10_10_10_rev GL_ARB_viewport_array GL_ARB_window_pos GL_ATI_draw_buffers GL_ATI_envmap_bumpmap GL_ATI_fragment_shader GL_ATI_meminfo GL_ATI_separate_stencil GL_ATI_texture_compression_3dc GL_ATI_texture_env_combine3 GL_ATI_texture_float GL_ATI_texture_mirror_once GL_EXT_abgr GL_EXT_bgra GL_EXT_bindable_uniform GL_EXT_blend_color GL_EXT_blend_equation_separate GL_EXT_blend_func_separate GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_compiled_vertex_array GL_EXT_copy_buffer GL_EXT_copy_texture GL_EXT_direct_state_access GL_EXT_draw_buffers2 GL_EXT_draw_instanced GL_EXT_draw_range_elements GL_EXT_fog_coord GL_EXT_framebuffer_blit GL_EXT_framebuffer_multisample GL_EXT_framebuffer_object GL_EXT_framebuffer_sRGB GL_EXT_geometry_shader4 GL_EXT_gpu_program_parameters GL_EXT_gpu_shader4 GL_EXT_histogram GL_EXT_multi_draw_arrays GL_EXT_packed_depth_stencil GL_EXT_packed_float GL_EXT_packed_pixels GL_EXT_pixel_buffer_object GL_EXT_point_parameters GL_EXT_provoking_vertex GL_EXT_rescale_normal GL_EXT_secondary_color GL_EXT_separate_specular_color GL_EXT_shadow_funcs GL_EXT_stencil_wrap GL_EXT_subtexture GL_EXT_texgen_reflection GL_EXT_texture3D GL_EXT_texture_array GL_EXT_texture_buffer_object GL_EXT_texture_compression_latc GL_EXT_texture_compression_rgtc GL_EXT_texture_compression_s3tc GL_EXT_texture_cube_map GL_EXT_texture_edge_clamp GL_EXT_texture_env_add GL_EXT_texture_env_combine GL_EXT_texture_env_dot3 GL_EXT_texture_filter_anisotropic GL_EXT_texture_integer GL_EXT_texture_lod GL_EXT_texture_lod_bias GL_EXT_texture_mirror_clamp GL_EXT_texture_object GL_EXT_texture_rectangle GL_EXT_texture_sRGB GL_EXT_texture_shared_exponent GL_EXT_texture_snorm GL_EXT_texture_storage GL_EXT_texture_swizzle GL_EXT_timer_query GL_EXT_transform_feedback GL_EXT_vertex_array GL_EXT_vertex_array_bgra GL_IBM_texture_mirrored_repeat GL_KTX_buffer_region GL_NV_blend_square GL_NV_conditional_render GL_NV_copy_depth_to_color GL_NV_copy_image GL_NV_explicit_multisample GL_NV_float_buffer GL_NV_half_float GL_NV_primitive_restart GL_NV_texgen_reflection GL_NV_texture_barrier GL_SGIS_generate_mipmap GL_SGIS_texture_edge_clamp GL_SGIS_texture_lod GL_SUN_multi_draw_arrays GL_WIN_swap_hint WGL_EXT_swap_control
15:50:51: Supported WGL extensions: WGL_ARB_extensions_string WGL_ARB_pixel_format WGL_ATI_pixel_format_float WGL_ARB_pixel_format_float WGL_ARB_multisample WGL_EXT_swap_control WGL_ARB_pbuffer WGL_ARB_render_texture WGL_ARB_make_current_read WGL_EXT_extensions_string WGL_ARB_buffer_region WGL_EXT_framebuffer_sRGB WGL_ATI_render_texture_rectangle WGL_EXT_pixel_format_packed_float WGL_I3D_genlock WGL_NV_swap_group WGL_ARB_create_context WGL_AMD_gpu_association WGL_AMDX_gpu_association WGL_ARB_create_context_profile WGL_NV_float_buffer
15:50:51: ***************************
15:50:51: *** GL Renderer Started ***
15:50:51: ***************************
15:50:51: Registering ResourceManager for type GpuProgram
15:50:51: GLSL support detected
15:50:51: GL: Using GL_EXT_framebuffer_object for rendering to textures (best)
15:50:51: FBO PF_UNKNOWN depth/stencil support: D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
15:50:51: FBO PF_L8 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
15:50:51: FBO PF_L16 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
15:50:51: FBO PF_A8 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
15:50:51: FBO PF_A4L4 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
15:50:51: FBO PF_BYTE_LA depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
15:50:51: FBO PF_R5G6B5 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
15:50:51: FBO PF_B5G6R5 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
15:50:51: FBO PF_A4R4G4B4 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
15:50:51: FBO PF_A1R5G5B5 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
15:50:51: FBO PF_R8G8B8 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
15:50:51: FBO PF_B8G8R8 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
15:50:51: FBO PF_A8R8G8B8 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
15:50:51: FBO PF_B8G8R8A8 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
15:50:51: FBO PF_A2R10G10B10 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
15:50:51: FBO PF_A2B10G10R10 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
15:50:51: FBO PF_FLOAT16_RGB depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
15:50:51: FBO PF_FLOAT16_RGBA depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
15:50:51: FBO PF_FLOAT32_RGB depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
15:50:51: FBO PF_FLOAT32_RGBA depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
15:50:51: FBO PF_X8R8G8B8 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
15:50:51: FBO PF_X8B8G8R8 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
15:50:51: FBO PF_SHORT_RGBA depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
15:50:51: FBO PF_R3G3B2 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
15:50:51: FBO PF_FLOAT16_R depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
15:50:51: FBO PF_FLOAT32_R depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
15:50:51: FBO PF_SHORT_GR depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
15:50:51: FBO PF_FLOAT16_GR depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
15:50:51: FBO PF_FLOAT32_GR depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
15:50:51: FBO PF_SHORT_RGB depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
15:50:51: [GL] : Valid FBO targets PF_UNKNOWN PF_L8 PF_L16 PF_A8 PF_A4L4 PF_BYTE_LA PF_R5G6B5 PF_B5G6R5 PF_A4R4G4B4 PF_A1R5G5B5 PF_R8G8B8 PF_B8G8R8 PF_A8R8G8B8 PF_B8G8R8A8 PF_A2R10G10B10 PF_A2B10G10R10 PF_FLOAT16_RGB PF_FLOAT16_RGBA PF_FLOAT32_RGB PF_FLOAT32_RGBA PF_X8R8G8B8 PF_X8B8G8R8 PF_SHORT_RGBA PF_R3G3B2 PF_FLOAT16_R PF_FLOAT32_R PF_SHORT_GR PF_FLOAT16_GR PF_FLOAT32_GR PF_SHORT_RGB
15:50:51: RenderSystem capabilities
15:50:51: -------------------------
15:50:51: RenderSystem Name: OpenGL Rendering Subsystem
15:50:51: GPU Vendor: ati
15:50:51: Device Name: ATI Radeon HD 4600 Series
15:50:51: Driver Version: 3.3.11653.0
15:50:51: * Fixed function pipeline: yes
15:50:51: * Hardware generation of mipmaps: yes
15:50:51: * Texture blending: yes
15:50:51: * Anisotropic texture filtering: yes
15:50:51: * Dot product texture operation: yes
15:50:51: * Cube mapping: yes
15:50:51: * Hardware stencil buffer: yes
15:50:51: - Stencil depth: 8
15:50:51: - Two sided stencil support: yes
15:50:51: - Wrap stencil values: yes
15:50:51: * Hardware vertex / index buffers: yes
15:50:51: * Vertex programs: yes
15:50:51: * Number of floating-point constants for vertex programs: 256
15:50:51: * Number of integer constants for vertex programs: 0
15:50:51: * Number of boolean constants for vertex programs: 0
15:50:51: * Fragment programs: yes
15:50:51: * Number of floating-point constants for fragment programs: 256
15:50:51: * Number of integer constants for fragment programs: 0
15:50:51: * Number of boolean constants for fragment programs: 0
15:50:51: * Geometry programs: yes
15:50:51: * Number of floating-point constants for geometry programs: 16384
15:50:51: * Number of integer constants for geometry programs: 0
15:50:51: * Number of boolean constants for geometry programs: 0
15:50:51: * Supported Shader Profiles: arbfp1 arbvp1 glsl gp4gp gpu_gp nvgp4 ps_1_1 ps_1_2 ps_1_3 ps_1_4
15:50:51: * Texture Compression: yes
15:50:51: - DXT: yes
15:50:51: - VTC: no
15:50:51: - PVRTC: no
15:50:51: * Scissor Rectangle: yes
15:50:51: * Hardware Occlusion Query: yes
15:50:51: * User clip planes: yes
15:50:51: * VET_UBYTE4 vertex element type: yes
15:50:51: * Infinite far plane projection: yes
15:50:51: * Hardware render-to-texture: yes
15:50:51: * Floating point textures: yes
15:50:51: * Non-power-of-two textures: yes
15:50:51: * Volume textures: yes
15:50:51: * Multiple Render Targets: 8
15:50:51: - With different bit depths: yes
15:50:51: * Point Sprites: yes
15:50:51: * Extended point parameters: yes
15:50:51: * Max Point Size: 8192
15:50:51: * Vertex texture fetch: yes
15:50:51: * Number of world matrices: 0
15:50:51: * Number of texture units: 16
15:50:51: * Stencil buffer depth: 8
15:50:51: * Number of vertex blend matrices: 0
15:50:51: - Max vertex textures: 16
15:50:51: - Vertex textures shared: yes
15:50:51: * Render to Vertex Buffer : no
15:50:51: * GL 1.5 without VBO workaround: no
15:50:51: * Frame Buffer objects: yes
15:50:51: * Frame Buffer objects (ARB extension): no
15:50:51: * Frame Buffer objects (ATI extension): no
15:50:51: * PBuffer support: yes
15:50:51: * GL 1.5 without HW-occlusion workaround: no
15:50:51: * Separate shader objects: no
15:50:51: Using FSAA from GL_ARB_multisample extension.
15:50:51: DefaultWorkQueue('Root') initialising on thread main.
15:50:51: Particle Renderer Type 'billboard' registered
15:50:51: Added resource location './meshes/' of type 'FileSystem' to resource group 'General'
15:50:51: Added resource location './materials/' of type 'FileSystem' to resource group 'General'
15:50:51: Added resource location './textures/' of type 'FileSystem' to resource group 'General'
15:50:51: Added resource location './medias/' of type 'FileSystem' to resource group 'General'
15:50:51: Parsing scripts for resource group Autodetect
15:50:51: Finished parsing scripts for resource group Autodetect
15:50:51: Creating resources for group Autodetect
15:50:51: All done
15:50:51: Parsing scripts for resource group General
15:50:52: Parsing script hovercraft.material
15:50:52: Finished parsing scripts for resource group General
15:50:52: Creating resources for group General
15:50:52: All done
15:50:52: Parsing scripts for resource group Internal
15:50:52: Finished parsing scripts for resource group Internal
15:50:52: Creating resources for group Internal
15:50:52: All done
15:50:52: Terrain created; size=513 minBatch=33 maxBatch=65 treeDepth=4 lodLevels=5 leafLods=2
15:50:53: Mesh: Loading hovercraft.mesh.
15:50:53: WARNING: hovercraft.mesh is an older format ([MeshSerializer_v1.30]); you should upgrade it as soon as possible using the OgreMeshUpgrade tool.
15:50:53: Texture: hovercraft_1.bmp: Loading 1 faces(PF_R8G8B8,64x64x1) with 6 hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,64x64x1.
15:50:53: Texture: crate.png: Loading 1 faces(PF_R8G8B8,256x256x1) with 8 hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,256x256x1.
15:50:53: Texture: spot_shadow_fade.png: Loading 1 faces(PF_R8G8B8,128x128x1) with 7 hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
15:50:53: OGRE EXCEPTION(3:RenderingAPIException): Failed to preprocess shader OgreTerrain/1497808685/sm2/vp/hlod/hlod in Ogre::GLSLProgram::loadFromSource at GLSL/src/OgreGLSLProgram.cpp (line 131)
15:50:53: High-level program OgreTerrain/1497808685/sm2/vp/hlod/hlod encountered an error during loading and is thus not supported.
OGRE EXCEPTION(3:RenderingAPIException): Failed to preprocess shader OgreTerrain/1497808685/sm2/vp/hlod/hlod in Ogre::GLSLProgram::loadFromSource at GLSL/src/OgreGLSLProgram.cpp (line 131)
15:50:53: OGRE EXCEPTION(3:RenderingAPIException): Failed to preprocess shader OgreTerrain/1497808685/sm2/fp/hlod in Ogre::GLSLProgram::loadFromSource at GLSL/src/OgreGLSLProgram.cpp (line 131)
15:50:53: High-level program OgreTerrain/1497808685/sm2/fp/hlod encountered an error during loading and is thus not supported.
OGRE EXCEPTION(3:RenderingAPIException): Failed to preprocess shader OgreTerrain/1497808685/sm2/fp/hlod in Ogre::GLSLProgram::loadFromSource at GLSL/src/OgreGLSLProgram.cpp (line 131)
15:50:53: OGRE EXCEPTION(3:RenderingAPIException): Failed to preprocess shader OgreTerrain/1497808685/sm2/vp/llod/llod in Ogre::GLSLProgram::loadFromSource at GLSL/src/OgreGLSLProgram.cpp (line 131)
15:50:53: High-level program OgreTerrain/1497808685/sm2/vp/llod/llod encountered an error during loading and is thus not supported.
OGRE EXCEPTION(3:RenderingAPIException): Failed to preprocess shader OgreTerrain/1497808685/sm2/vp/llod/llod in Ogre::GLSLProgram::loadFromSource at GLSL/src/OgreGLSLProgram.cpp (line 131)
15:50:53: OGRE EXCEPTION(3:RenderingAPIException): Failed to preprocess shader OgreTerrain/1497808685/sm2/fp/llod in Ogre::GLSLProgram::loadFromSource at GLSL/src/OgreGLSLProgram.cpp (line 131)
15:50:53: High-level program OgreTerrain/1497808685/sm2/fp/llod encountered an error during loading and is thus not supported.
OGRE EXCEPTION(3:RenderingAPIException): Failed to preprocess shader OgreTerrain/1497808685/sm2/fp/llod in Ogre::GLSLProgram::loadFromSource at GLSL/src/OgreGLSLProgram.cpp (line 131)
15:50:53: WARNING: material OgreTerrain/1497808685 has no supportable Techniques and will be blank. Explanation:
Pass 0: Vertex program OgreTerrain/1497808685/sm2/vp/hlod/hlod cannot be used - compile error.
Pass 0: Vertex program OgreTerrain/1497808685/sm2/vp/llod/llod cannot be used - compile error.

15:50:53: OGRE EXCEPTION(3:RenderingAPIException): Failed to preprocess shader OgreTerrain/1497808685/sm2/vp/comp/comp in Ogre::GLSLProgram::loadFromSource at GLSL/src/OgreGLSLProgram.cpp (line 131)
15:50:53: High-level program OgreTerrain/1497808685/sm2/vp/comp/comp encountered an error during loading and is thus not supported.
OGRE EXCEPTION(3:RenderingAPIException): Failed to preprocess shader OgreTerrain/1497808685/sm2/vp/comp/comp in Ogre::GLSLProgram::loadFromSource at GLSL/src/OgreGLSLProgram.cpp (line 131)
15:50:53: OGRE EXCEPTION(3:RenderingAPIException): Failed to preprocess shader OgreTerrain/1497808685/sm2/fp/comp in Ogre::GLSLProgram::loadFromSource at GLSL/src/OgreGLSLProgram.cpp (line 131)
15:50:53: High-level program OgreTerrain/1497808685/sm2/fp/comp encountered an error during loading and is thus not supported.
OGRE EXCEPTION(3:RenderingAPIException): Failed to preprocess shader OgreTerrain/1497808685/sm2/fp/comp in Ogre::GLSLProgram::loadFromSource at GLSL/src/OgreGLSLProgram.cpp (line 131)
15:50:53: WARNING: material OgreTerrain/1497808685/comp has no supportable Techniques and will be blank. Explanation:
Pass 0: Vertex program OgreTerrain/1497808685/sm2/vp/comp/comp cannot be used - compile error.
Ogre.log en directx (ombres désactivées sinon plantage)
15:52:40: Creating resource group General
15:52:40: Creating resource group Internal
15:52:40: Creating resource group Autodetect
15:52:40: SceneManagerFactory for type 'DefaultSceneManager' registered.
15:52:40: Registering ResourceManager for type Material
15:52:40: Registering ResourceManager for type Mesh
15:52:40: Registering ResourceManager for type Skeleton
15:52:40: MovableObjectFactory for type 'ParticleSystem' registered.
15:52:40: OverlayElementFactory for type Panel registered.
15:52:40: OverlayElementFactory for type BorderPanel registered.
15:52:40: OverlayElementFactory for type TextArea registered.
15:52:40: Registering ResourceManager for type Font
15:52:40: ArchiveFactory for archive type FileSystem registered.
15:52:40: ArchiveFactory for archive type Zip registered.
15:52:40: ArchiveFactory for archive type EmbeddedZip registered.
15:52:40: DDS codec registering
15:52:40: FreeImage version: 3.10.0
15:52:40: This program uses FreeImage, a free, open source image library supporting all common bitmap formats. See http://freeimage.sourceforge.net for details
15:52:40: Supported formats: bmp,ico,jpg,jif,jpeg,jpe,koa,iff,lbm,pbm,pbm,pcd,pcx,pgm,pgm,png,ppm,ppm,ras,tga,targa,tif,tiff,wap,wbmp,wbm,psd,cut,xbm,xpm,dds,gif,g3,sgi,j2k,j2c,jp2
15:52:40: PVRTC codec registering
15:52:40: Registering ResourceManager for type HighLevelGpuProgram
15:52:40: Registering ResourceManager for type Compositor
15:52:40: MovableObjectFactory for type 'Entity' registered.
15:52:40: MovableObjectFactory for type 'Light' registered.
15:52:40: MovableObjectFactory for type 'BillboardSet' registered.
15:52:40: MovableObjectFactory for type 'ManualObject' registered.
15:52:40: MovableObjectFactory for type 'BillboardChain' registered.
15:52:40: MovableObjectFactory for type 'RibbonTrail' registered.
15:52:40: *-*-* OGRE Initialising
15:52:40: *-*-* Version 1.8.0 (Byatis)
15:52:40: D3D9 : Direct3D9 Rendering Subsystem created.
15:52:40: D3D9: Driver Detection Starts
15:52:40: D3D9: Driver Detection Ends
15:52:40: OpenGL Rendering Subsystem created.
15:52:42: Particle Emitter Type 'Point' registered
15:52:42: Particle Emitter Type 'Box' registered
15:52:42: Particle Emitter Type 'Ellipsoid' registered
15:52:42: Particle Emitter Type 'Cylinder' registered
15:52:42: Particle Emitter Type 'Ring' registered
15:52:42: Particle Emitter Type 'HollowEllipsoid' registered
15:52:42: Particle Affector Type 'LinearForce' registered
15:52:42: Particle Affector Type 'ColourFader' registered
15:52:42: Particle Affector Type 'ColourFader2' registered
15:52:42: Particle Affector Type 'ColourImage' registered
15:52:42: Particle Affector Type 'ColourInterpolator' registered
15:52:42: Particle Affector Type 'Scaler' registered
15:52:42: Particle Affector Type 'Rotator' registered
15:52:42: Particle Affector Type 'DirectionRandomiser' registered
15:52:42: Particle Affector Type 'DeflectorPlane' registered
15:52:42: PCZone Factory Type 'ZoneType_Default' registered
15:52:42: CPU Identifier & Features
15:52:42: -------------------------
15:52:42: * CPU ID: GenuineIntel: Intel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHz
15:52:42: * SSE: yes
15:52:42: * SSE2: yes
15:52:42: * SSE3: yes
15:52:42: * MMX: yes
15:52:42: * MMXEXT: yes
15:52:42: * 3DNOW: no
15:52:42: * 3DNOWEXT: no
15:52:42: * CMOV: yes
15:52:42: * TSC: yes
15:52:42: * FPU: yes
15:52:42: * PRO: yes
15:52:42: * HT: no
15:52:42: -------------------------
15:52:42: D3D9 : Subsystem Initialising
15:52:42: Registering ResourceManager for type Texture
15:52:42: Registering ResourceManager for type GpuProgram
15:52:42: ***************************************
15:52:42: *** D3D9 : Subsystem Initialised OK ***
15:52:42: ***************************************
15:52:42: SceneManagerFactory for type 'OctreeSceneManager' registered.
15:52:42: SceneManagerFactory for type 'BspSceneManager' registered.
15:52:42: Registering ResourceManager for type BspLevel
15:52:42: D3D9RenderSystem::_createRenderWindow "PureBasic Ogre", 800x500 windowed miscParams: FSAA=0 displayFrequency=0 externalWindowHandle=136698 vsync=true
15:52:42: D3D9 : Created D3D9 Rendering Window 'PureBasic Ogre' : 800x500, 32bpp
15:52:42: D3D9: Vertex texture format supported - PF_L8
15:52:42: D3D9: Vertex texture format supported - PF_L16
15:52:42: D3D9: Vertex texture format supported - PF_A8
15:52:42: D3D9: Vertex texture format supported - PF_A4L4
15:52:42: D3D9: Vertex texture format supported - PF_BYTE_LA
15:52:42: D3D9: Vertex texture format supported - PF_R5G6B5
15:52:42: D3D9: Vertex texture format supported - PF_B5G6R5
15:52:42: D3D9: Vertex texture format supported - PF_A4R4G4B4
15:52:42: D3D9: Vertex texture format supported - PF_A1R5G5B5
15:52:42: D3D9: Vertex texture format supported - PF_A8R8G8B8
15:52:42: D3D9: Vertex texture format supported - PF_B8G8R8A8
15:52:42: D3D9: Vertex texture format supported - PF_A2R10G10B10
15:52:42: D3D9: Vertex texture format supported - PF_A2B10G10R10
15:52:42: D3D9: Vertex texture format supported - PF_DXT1
15:52:42: D3D9: Vertex texture format supported - PF_DXT2
15:52:42: D3D9: Vertex texture format supported - PF_DXT3
15:52:42: D3D9: Vertex texture format supported - PF_DXT4
15:52:42: D3D9: Vertex texture format supported - PF_DXT5
15:52:42: D3D9: Vertex texture format supported - PF_FLOAT16_RGB
15:52:42: D3D9: Vertex texture format supported - PF_FLOAT16_RGBA
15:52:42: D3D9: Vertex texture format supported - PF_FLOAT32_RGB
15:52:42: D3D9: Vertex texture format supported - PF_FLOAT32_RGBA
15:52:42: D3D9: Vertex texture format supported - PF_X8R8G8B8
15:52:42: D3D9: Vertex texture format supported - PF_X8B8G8R8
15:52:42: D3D9: Vertex texture format supported - PF_R8G8B8A8
15:52:42: D3D9: Vertex texture format supported - PF_DEPTH
15:52:42: D3D9: Vertex texture format supported - PF_SHORT_RGBA
15:52:42: D3D9: Vertex texture format supported - PF_FLOAT16_R
15:52:42: D3D9: Vertex texture format supported - PF_FLOAT32_R
15:52:42: D3D9: Vertex texture format supported - PF_SHORT_GR
15:52:42: D3D9: Vertex texture format supported - PF_FLOAT16_GR
15:52:42: D3D9: Vertex texture format supported - PF_FLOAT32_GR
15:52:42: D3D9: Vertex texture format supported - PF_SHORT_RGB
15:52:42: D3D9: Vertex texture format supported - PF_PVRTC_RGB2
15:52:42: D3D9: Vertex texture format supported - PF_PVRTC_RGBA2
15:52:42: D3D9: Vertex texture format supported - PF_PVRTC_RGB4
15:52:42: D3D9: Vertex texture format supported - PF_PVRTC_RGBA4
15:52:42: D3D9: Vertex texture format supported - PF_R8
15:52:42: D3D9: Vertex texture format supported - PF_RG8
15:52:42: RenderSystem capabilities
15:52:42: -------------------------
15:52:42: RenderSystem Name: Direct3D9 Rendering Subsystem
15:52:42: GPU Vendor: ati
15:52:42: Device Name: Monitor-1-ATI Radeon HD 4600 Series
15:52:42: Driver Version: 6.14.10.7267
15:52:42: * Fixed function pipeline: yes
15:52:42: * Hardware generation of mipmaps: yes
15:52:42: * Texture blending: yes
15:52:42: * Anisotropic texture filtering: yes
15:52:42: * Dot product texture operation: yes
15:52:42: * Cube mapping: yes
15:52:42: * Hardware stencil buffer: yes
15:52:42: - Stencil depth: 8
15:52:42: - Two sided stencil support: yes
15:52:42: - Wrap stencil values: yes
15:52:42: * Hardware vertex / index buffers: yes
15:52:42: * Vertex programs: yes
15:52:42: * Number of floating-point constants for vertex programs: 256
15:52:42: * Number of integer constants for vertex programs: 16
15:52:42: * Number of boolean constants for vertex programs: 16
15:52:42: * Fragment programs: yes
15:52:42: * Number of floating-point constants for fragment programs: 224
15:52:42: * Number of integer constants for fragment programs: 16
15:52:42: * Number of boolean constants for fragment programs: 16
15:52:42: * Geometry programs: no
15:52:42: * Number of floating-point constants for geometry programs: 0
15:52:42: * Number of integer constants for geometry programs: 0
15:52:42: * Number of boolean constants for geometry programs: 0
15:52:42: * Supported Shader Profiles: hlsl ps_1_1 ps_1_2 ps_1_3 ps_1_4 ps_2_0 ps_2_a ps_2_b ps_2_x ps_3_0 vs_1_1 vs_2_0 vs_2_a vs_2_x vs_3_0
15:52:42: * Texture Compression: yes
15:52:42: - DXT: yes
15:52:42: - VTC: no
15:52:42: - PVRTC: no
15:52:42: * Scissor Rectangle: yes
15:52:42: * Hardware Occlusion Query: yes
15:52:42: * User clip planes: yes
15:52:42: * VET_UBYTE4 vertex element type: yes
15:52:42: * Infinite far plane projection: yes
15:52:42: * Hardware render-to-texture: yes
15:52:42: * Floating point textures: yes
15:52:42: * Non-power-of-two textures: yes
15:52:42: * Volume textures: yes
15:52:42: * Multiple Render Targets: 4
15:52:42: - With different bit depths: yes
15:52:42: * Point Sprites: yes
15:52:42: * Extended point parameters: yes
15:52:42: * Max Point Size: 256
15:52:42: * Vertex texture fetch: yes
15:52:42: * Number of world matrices: 0
15:52:42: * Number of texture units: 8
15:52:42: * Stencil buffer depth: 8
15:52:42: * Number of vertex blend matrices: 0
15:52:42: - Max vertex textures: 4
15:52:42: - Vertex textures shared: no
15:52:42: * Render to Vertex Buffer : no
15:52:42: * DirectX per stage constants: yes
15:52:42: DefaultWorkQueue('Root') initialising on thread main.
15:52:42: Particle Renderer Type 'billboard' registered
15:52:42: Added resource location './meshes/' of type 'FileSystem' to resource group 'General'
15:52:42: Added resource location './materials/' of type 'FileSystem' to resource group 'General'
15:52:42: Added resource location './textures/' of type 'FileSystem' to resource group 'General'
15:52:42: Added resource location './medias/' of type 'FileSystem' to resource group 'General'
15:52:42: Parsing scripts for resource group Autodetect
15:52:42: Finished parsing scripts for resource group Autodetect
15:52:42: Creating resources for group Autodetect
15:52:42: All done
15:52:42: Parsing scripts for resource group General
15:52:42: Parsing script hovercraft.material
15:52:42: Finished parsing scripts for resource group General
15:52:42: Creating resources for group General
15:52:42: All done
15:52:42: Parsing scripts for resource group Internal
15:52:42: Finished parsing scripts for resource group Internal
15:52:42: Creating resources for group Internal
15:52:42: All done
15:52:42: Terrain created; size=513 minBatch=33 maxBatch=65 treeDepth=4 lodLevels=5 leafLods=2
15:52:43: Mesh: Loading hovercraft.mesh.
15:52:43: WARNING: hovercraft.mesh is an older format ([MeshSerializer_v1.30]); you should upgrade it as soon as possible using the OgreMeshUpgrade tool.
15:52:43: Texture: hovercraft_1.bmp: Loading 1 faces(PF_R8G8B8,64x64x1) Internal format is PF_X8R8G8B8,64x64x1.
15:52:43: Texture: crate.png: Loading 1 faces(PF_R8G8B8,256x256x1) Internal format is PF_X8R8G8B8,256x256x1.
15:52:43: OGRE EXCEPTION(3:RenderingAPIException): Cannot assemble D3D9 high-level shader OgreTerrain/149514840/sm2/vp/hlod in D3D9HLSLProgram::loadFromSource at OgreD3D9HLSLProgram.cpp (line 281)
15:52:43: High-level program OgreTerrain/149514840/sm2/vp/hlod encountered an error during loading and is thus not supported.
OGRE EXCEPTION(3:RenderingAPIException): Cannot assemble D3D9 high-level shader OgreTerrain/149514840/sm2/vp/hlod in D3D9HLSLProgram::loadFromSource at OgreD3D9HLSLProgram.cpp (line 281)
15:52:43: OGRE EXCEPTION(3:RenderingAPIException): Cannot assemble D3D9 high-level shader OgreTerrain/149514840/sm2/fp/hlod in D3D9HLSLProgram::loadFromSource at OgreD3D9HLSLProgram.cpp (line 281)
15:52:43: High-level program OgreTerrain/149514840/sm2/fp/hlod encountered an error during loading and is thus not supported.
OGRE EXCEPTION(3:RenderingAPIException): Cannot assemble D3D9 high-level shader OgreTerrain/149514840/sm2/fp/hlod in D3D9HLSLProgram::loadFromSource at OgreD3D9HLSLProgram.cpp (line 281)
15:52:43: OGRE EXCEPTION(3:RenderingAPIException): Cannot assemble D3D9 high-level shader OgreTerrain/149514840/sm2/vp/llod in D3D9HLSLProgram::loadFromSource at OgreD3D9HLSLProgram.cpp (line 281)
15:52:43: High-level program OgreTerrain/149514840/sm2/vp/llod encountered an error during loading and is thus not supported.
OGRE EXCEPTION(3:RenderingAPIException): Cannot assemble D3D9 high-level shader OgreTerrain/149514840/sm2/vp/llod in D3D9HLSLProgram::loadFromSource at OgreD3D9HLSLProgram.cpp (line 281)
15:52:43: OGRE EXCEPTION(3:RenderingAPIException): Cannot assemble D3D9 high-level shader OgreTerrain/149514840/sm2/fp/llod in D3D9HLSLProgram::loadFromSource at OgreD3D9HLSLProgram.cpp (line 281)
15:52:43: High-level program OgreTerrain/149514840/sm2/fp/llod encountered an error during loading and is thus not supported.
OGRE EXCEPTION(3:RenderingAPIException): Cannot assemble D3D9 high-level shader OgreTerrain/149514840/sm2/fp/llod in D3D9HLSLProgram::loadFromSource at OgreD3D9HLSLProgram.cpp (line 281)
15:52:43: WARNING: material OgreTerrain/149514840 has no supportable Techniques and will be blank. Explanation:
Pass 0: Vertex program OgreTerrain/149514840/sm2/vp/hlod cannot be used - compile error.
Pass 0: Vertex program OgreTerrain/149514840/sm2/vp/llod cannot be used - compile error.

15:52:43: OGRE EXCEPTION(3:RenderingAPIException): Cannot assemble D3D9 high-level shader OgreTerrain/149514840/sm2/vp/comp in D3D9HLSLProgram::loadFromSource at OgreD3D9HLSLProgram.cpp (line 281)
15:52:43: High-level program OgreTerrain/149514840/sm2/vp/comp encountered an error during loading and is thus not supported.
OGRE EXCEPTION(3:RenderingAPIException): Cannot assemble D3D9 high-level shader OgreTerrain/149514840/sm2/vp/comp in D3D9HLSLProgram::loadFromSource at OgreD3D9HLSLProgram.cpp (line 281)
15:52:43: OGRE EXCEPTION(3:RenderingAPIException): Cannot assemble D3D9 high-level shader OgreTerrain/149514840/sm2/fp/comp in D3D9HLSLProgram::loadFromSource at OgreD3D9HLSLProgram.cpp (line 281)
15:52:43: High-level program OgreTerrain/149514840/sm2/fp/comp encountered an error during loading and is thus not supported.
OGRE EXCEPTION(3:RenderingAPIException): Cannot assemble D3D9 high-level shader OgreTerrain/149514840/sm2/fp/comp in D3D9HLSLProgram::loadFromSource at OgreD3D9HLSLProgram.cpp (line 281)
15:52:43: WARNING: material OgreTerrain/149514840/comp has no supportable Techniques and will be blank. Explanation:
Pass 0: Vertex program OgreTerrain/149514840/sm2/vp/comp cannot be used - compile error.
kelebrindae
Messages : 579
Inscription : ven. 11/mai/2007 15:21

Re: [PB5.00 b5] Aéroglisseur + terrain + physique

Message par kelebrindae »

Essaie en DirectX: il me semble avoir lu quelque part qu'il y avait des problèmes avec le shader utilisé par les terrains en OpenGL.

[EDIT] ce que semble confirmer ce passage de ton Ogre.log:
15:52:43: OGRE EXCEPTION(3:RenderingAPIException): Cannot assemble D3D9 high-level shader OgreTerrain/149514840/sm2/vp/comp in
Les idées sont le souvenir de choses qui ne se sont pas encore produites.
Avatar de l’utilisateur
djes
Messages : 4252
Inscription : ven. 11/févr./2005 17:34
Localisation : Arras, France

Re: [PB5.00 b5] Aéroglisseur + terrain + physique

Message par djes »

Tu n'as pas bien regardé, j'ai mis les deux essais, le premier en opengl, le deuxième en directx.
comtois
Messages : 5186
Inscription : mer. 21/janv./2004 17:48
Contact :

Re: [PB5.00 b5] Aéroglisseur + terrain + physique

Message par comtois »

C'est une superbe démo, elle fonctionne très bien ici :)
Plus qu'à gérer une spline sur un deuxième overcraft et on peut faire des courses.

djes, voici la fin de mon log, apparemment tu as un problème de shader, ce qui peut expliquer ton problème de shadows ? J'imagine que tu as tes drivers à jour, et que tu utilises le dernier sdk directx 9 ?
Au cas où, jette un coup d'oeil ici :
http://www.microsoft.com/en-us/download ... aspx?id=35
18:05:03: Terrain created; size=513 minBatch=33 maxBatch=65 treeDepth=4 lodLevels=5 leafLods=2
18:05:03: Mesh: Loading hovercraft.mesh.
18:05:04: WARNING: hovercraft.mesh is an older format ([MeshSerializer_v1.30]); you should upgrade it as soon as possible using the OgreMeshUpgrade tool.
18:05:04: Texture: hovercraft_1.bmp: Loading 1 faces(PF_R8G8B8,64x64x1) Internal format is PF_X8R8G8B8,64x64x1.
18:05:04: Texture: crate.png: Loading 1 faces(PF_R8G8B8,256x256x1) Internal format is PF_X8R8G8B8,256x256x1.
18:05:04: Texture: spot_shadow_fade.png: Loading 1 faces(PF_R8G8B8,128x128x1) Internal format is PF_X8R8G8B8,128x128x1.
18:05:04: Texture: sand.jpg: Loading 1 faces(PF_R8G8B8,512x512x1) Internal format is PF_X8R8G8B8,512x512x1.
18:05:04: Texture: sand_n.jpg: Loading 1 faces(PF_R8G8B8,512x512x1) Internal format is PF_X8R8G8B8,512x512x1.
18:05:04: Texture: grass.jpg: Loading 1 faces(PF_R8G8B8,512x512x1) Internal format is PF_X8R8G8B8,512x512x1.
18:05:04: Texture: grass_n.jpg: Loading 1 faces(PF_R8G8B8,512x512x1) Internal format is PF_X8R8G8B8,512x512x1.
18:05:04: Texture: rock.jpg: Loading 1 faces(PF_R8G8B8,512x512x1) Internal format is PF_X8R8G8B8,512x512x1.
18:05:04: Texture: rock_n.jpg: Loading 1 faces(PF_R8G8B8,512x512x1) Internal format is PF_X8R8G8B8,512x512x1.
http://purebasic.developpez.com/
Je ne réponds à aucune question technique en PV, utilisez le forum, il est fait pour ça, et la réponse peut profiter à tous.
comtois
Messages : 5186
Inscription : mer. 21/janv./2004 17:48
Contact :

Re: [PB5.00 b5] Aéroglisseur + terrain + physique

Message par comtois »

djes, tu as essayé les démos compilées d'ogre ?
http://www.ogre3d.org/download/demos

ça serait intéressant de savoir si les ombres et l'exemple terrain fonctionnent avec ta carte.
http://purebasic.developpez.com/
Je ne réponds à aucune question technique en PV, utilisez le forum, il est fait pour ça, et la réponse peut profiter à tous.
comtois
Messages : 5186
Inscription : mer. 21/janv./2004 17:48
Contact :

Re: [PB5.00 b5] Aéroglisseur + terrain + physique

Message par comtois »

si tu veux améliorer le rendu de ton terrain, utilise :

- Une lumière directionnelle
- Ajoute la couleur spéculaire
- Change la direction de ta lumière

Toutes ces données sont utilisées pour calculer le rendu. C'est pour ça qu'on passe la lumière utilisée à la fonction SetupTerrains()
Tu peux essayer la différence avec ça :

Code : Tout sélectionner

light = CreateLight(#PB_Any ,$FFFFFF, 500, 750, 500,#PB_Light_Directional)
LightColor(light, $AAAAAA, #PB_Light_SpecularColor)
LightDirection(light, 0.55, -0.3, -0.75) 
AmbientColor($222222)
http://purebasic.developpez.com/
Je ne réponds à aucune question technique en PV, utilisez le forum, il est fait pour ça, et la réponse peut profiter à tous.
Mesa
Messages : 1126
Inscription : mer. 14/sept./2011 16:59

Re: [PB5.00 b5] Aéroglisseur + terrain + physique

Message par Mesa »

Moi aussi, j'ai un fond bleu même en désactivant les ombres. La fonction CreateTerrain me renvoie 0.

Mais mon matériel est obsolète pour la 3D : Geforce FX5500 256M qui doit dater de 2007 environ..., même avec directx9 et pilote à jour.

J'ai installé la démo d'Ogre et certaines démos ne fonctionnent pas :
OGRE m'avertit que mon matériel est out avec
Deferred Shadow, isosurf et particule effects GPU.

J'ai un plantage avec shader system et terrain avec option depth shadow .

Et j'ai des carrés noirs avec julia parameter.

Voilà, si ça peut aider.

Mesa.
Golfy
Messages : 423
Inscription : mer. 25/août/2004 15:14
Localisation : Grenoble
Contact :

Re: [PB5.00 b5] Aéroglisseur + terrain + physique

Message par Golfy »

Je suis sous Win7 64bits (DirectX11 d'après dxdiag) et Purebasic 5.00 beta 4 (+ATI Radeon HD5570 et drivers Catalyst à jour)

Tout est OK (j'avais initialement pas vu le fichier ZIP). :lol:
Purebasic 5.30 full sous Windows XP (x86) et Win7 (64 bits), Linux Debian. Orientation réseaux, domotique
http://golfy.olympe.in/Teo-Tea/
Fred
Site Admin
Messages : 2807
Inscription : mer. 21/janv./2004 11:03

Re: [PB5.00 b5] Aéroglisseur + terrain + physique

Message par Fred »

Excellent, ca rend vraiment bien !! N'hesite pas à poster sur le forum anglais dans la partie 3d :)
kelebrindae
Messages : 579
Inscription : ven. 11/mai/2007 15:21

Re: [PB5.00 b5] Aéroglisseur + terrain + physique

Message par kelebrindae »

Merci! :D

J'ajoute un ou deux trucs rapides (quelques objets de-ce de-là, pour décorer), et je posterai le résultat.
Les idées sont le souvenir de choses qui ne se sont pas encore produites.
Avatar de l’utilisateur
venom
Messages : 3136
Inscription : jeu. 29/juil./2004 16:33
Localisation : Klyntar
Contact :

Re: [PB5.00 b5] Aéroglisseur + terrain + physique

Message par venom »

Fonctionne bien chez moi. Bien jouer




@++
Windows 10 x64, PureBasic 5.73 x86 & x64
GPU : radeon HD6370M, CPU : p6200 2.13Ghz
comtois
Messages : 5186
Inscription : mer. 21/janv./2004 17:48
Contact :

Re: [PB5.00 b5] Aéroglisseur + terrain + physique

Message par comtois »

En fait, le principal truc qui me chiffonne, c'est que je n'ai pas réussi à déterminer avec précision quand le vaisseau touche le sol => sur les pentes élevées, le contact n'est pas détecté et le vaisseau ne s'adapte plus à l'angle du terrain (je n'arrive pas à m'expliquer clairement; voyez par vous-même).
C'est sans doute un bug dans la fonction TerrainHeight(), je testerai ça ce week-end.
http://purebasic.developpez.com/
Je ne réponds à aucune question technique en PV, utilisez le forum, il est fait pour ça, et la réponse peut profiter à tous.
Répondre