un exemple de de bump texture avec SpiderBasic et Babylon.sbiGuillot dans un autre topic a écrit :c'est pas du bump, helas on à pas ça en PB (sauf à utiliser les scripts),
Démonstration http://falsam.com/sbbjs/bumptexture.html
Création de la sphère d'un rayon de 8 unités
Code : Tout sélectionner
Sphere = CreateSphere("sphere", 8)
Code : Tout sélectionner
Material = CreateMaterial("ground")
-Texture de bump
Ajouter la texture de sol au material
Code : Tout sélectionner
Texture = LoadTexture("Data/textures/floor.png")
SetMaterialTexture(Material, #BJS_Diffuse, Texture)
Code : Tout sélectionner
Texture = LoadTexture("Data/textures/floor_bump.PNG")
SetMaterialTexture(Material, #BJS_Bump, Texture)
Code : Tout sélectionner
SetMeshMaterial(Sphere, Material)
Code : Tout sélectionner
;Babylon.sbi - Bump Texture
EnableExplicit
IncludeFile "babylon/babylon.sbi"
UseModule BJS
Global Scene, Camera, Sphere, Material, Texture
Declare LoadGame()
Declare RenderGame()
InitEngine(@LoadGame())
Procedure LoadGame()
Scene = CreateScene()
If Scene
Camera = CreateCamera("camera", 0, 10, 20, #BJS_ArcRotate)
ClearScene(RGB(128, 128, 128))
CreateLight("light", 0, 20, 0, 0.8)
Sphere = CreateSphere("sphere", 8)
Material = CreateMaterial("ground")
Texture = LoadTexture("Data/textures/floor.png")
SetMaterialTexture(Material, #BJS_Diffuse, Texture)
Texture = LoadTexture("Data/textures/floor_bump.PNG")
SetMaterialTexture(Material, #BJS_Bump, Texture)
SetMeshMaterial(Sphere, Material)
RenderLoop(@RenderGame())
EndIf
EndProcedure
Procedure RenderGame()
RotateMesh(Sphere, 0.5, 0.5, 0.5, #PB_Relative)
RenderWorld()
EndProcedure