
and it is not bad, since my graphics card are Geforce 520 GT which have memory 2GB DDR3. on windows xp. cpu: i5-2500 3.3 GHZ. usable ram 3.23 GB. it is possible better on windows 7 or windows 8 .
Edit: i don't see the fps is different if we use a normal material for the model such as the the floor material #FloorMat. so could be my graphics card does not support hardware skinning !!
here is your code for the hlsl v2 version to show the above soldiers circles :
Code: Select all
Define.f KeyX, KeyY, MouseX, MouseY
Enumeration
#Info
#Window
#Font
#FloorTex
#FloorMat
#JaiquaMat
#JaiquaMesh
#Jaiqua
#PlaneMesh
#Plane
#Camera
#Light1
#Light2
EndEnumeration
If InitEngine3D(#PB_Engine3D_DebugLog)
Add3DArchive("\", #PB_3DArchive_FileSystem)
Parse3DScripts()
InitSprite()
InitKeyboard()
InitMouse()
If LoadFont(#Font, "Courier New", 10,#PB_Font_Bold)
SetGadgetFont(#PB_Default, FontID(#Font))
EndIf
ExamineDesktops()
DesktopW = DesktopWidth(0)
DesktopH = DesktopHeight(0)
Total=100
If OpenWindow(#Window, 0, 0, DesktopW, DesktopH, "Hardware Skinning")
If OpenWindowedScreen(WindowID(#Window), 0, 0, DesktopW, DesktopH, 0, 0, 0)
CPU$ = CPUName()
CreateSprite(#Info, 350, 120)
StartDrawing(SpriteOutput(#Info))
Box(0,0,350,120,RGB(0,0,0))
StopDrawing()
CreateTexture(#FloorTex,32,32)
StartDrawing(TextureOutput(#FloorTex))
Box(0,0,16,16,RGB(55,55,55))
Box(16,0,16,16,RGB(0,50,75))
Box(0,16,16,16,RGB(0,50,75))
Box(16,16,16,16,RGB(55,55,55))
StopDrawing()
CreateMaterial(#FloorMat, TextureID(#FloorTex))
CreatePlane(#PlaneMesh, 150, 150, 1, 1, 30, 30)
CreateEntity(#Plane,MeshID(#PlaneMesh),MaterialID(#FloorMat),0.1,-0.2,0.2)
GetScriptMaterial(#JaiquaMat,"jaiqua")
LoadMesh(#JaiquaMesh,"jaiqua.mesh")
For EN=1 To Total
X.f=X+#PI*2/Total
Z.f=Z+#PI*2/Total
XX.f=Cos(X)*60
ZZ.f=Sin(Z)*60
Jaiqua=CreateEntity(#PB_Any, MeshID(#JaiquaMesh), MaterialID(#JaiquaMat),XX,0,ZZ)
ScaleEntity(Jaiqua,0.2,0.2,0.2)
RotateEntity(Jaiqua,0,180,0)
StartEntityAnimation(Jaiqua, "Sneak")
Next
X=0
Z=0
For EN=1 To Total
X=X+#PI*2/Total
Z=Z+#PI*2/Total
XX.f=Cos(X)*30
ZZ.f=Sin(Z)*30
Jaiqua=CreateEntity(#PB_Any, MeshID(#JaiquaMesh), MaterialID(#JaiquaMat),XX,0,ZZ)
ScaleEntity(Jaiqua,0.2,0.2,0.2)
RotateEntity(Jaiqua,0,180,0)
StartEntityAnimation(Jaiqua, "Sneak")
Next
CreateCamera(#Camera, 0, 0, 100, 100)
MoveCamera(#Camera, 0, 5, 20, #PB_Absolute)
CameraLookAt(#Camera,0,0,0)
CreateLight(#Light1, RGB(0, 0, 0), -20, 40, 20)
SetLightColor(#Light1, #PB_Light_DiffuseColor, RGB(255,255,255))
CreateLight(#Light2, RGB(0, 0, 0), 20, 40, 20)
SetLightColor(#Light2, #PB_Light_DiffuseColor, RGB(0,0,255))
AmbientColor(RGB(80, 80, 80))
EndIf
EndIf
Repeat
If ExamineMouse()
MouseX = -MouseDeltaX()/20
MouseY = -MouseDeltaY()/20
EndIf
If ExamineKeyboard()
If KeyboardPushed(#PB_Key_Left)
KeyX = -1
ElseIf KeyboardPushed(#PB_Key_Right)
KeyX = 1
Else
KeyX = 0
EndIf
If KeyboardPushed(#PB_Key_Up)
KeyY = -1
ElseIf KeyboardPushed(#PB_Key_Down)
KeyY = 1
Else
KeyY = 0
EndIf
EndIf
RotateCamera(#Camera, MouseY, MouseX, 0, #PB_Relative)
MoveCamera(#Camera, KeyX, 0, KeyY)
RenderWorld()
ShowFPS=1
If ShowFPS=1
CurrentFPS = Engine3DFrameRate(#PB_Engine3D_Current)
AverageFPS = Engine3DFrameRate(#PB_Engine3D_Average)
MaximumFPS = Engine3DFrameRate(#PB_Engine3D_Maximum)
MinimumFPS = Engine3DFrameRate(#PB_Engine3D_Minimum)
CountTris=CountRenderedTriangles()
StartDrawing(SpriteOutput(#Info))
Box(0,0,350,120,RGB(40,40,40))
DrawingFont(FontID(#Font))
DrawText(2,2,CPU$,RGB(255,0,0),RGB(40,40,40))
DrawText(2,22,"Current FPS : "+Str(CurrentFPS),RGB(0,255,255),RGB(40,40,40))
DrawText(2,42,"Average FPS : "+Str(AverageFPS),RGB(0,255,255),RGB(40,40,40))
DrawText(2,62,"Maximum FPS : "+Str(MaximumFPS),RGB(0,255,255),RGB(40,40,40))
DrawText(2,82,"Minimum FPS : "+Str(MinimumFPS),RGB(0,255,255),RGB(40,40,40))
DrawText(2,102,"Rendered Triangles : "+Str(CountTris),RGB(0,255,0),RGB(40,40,40))
StopDrawing()
DisplayTransparentSprite(#Info,20,20)
If FirstFrame=0
Engine3DFrameRate(#PB_Engine3D_Reset)
FirstFrame=1
EndIf
EndIf
FlipBuffers()
Until KeyboardPushed(#PB_Key_Escape) Or Quit = 1
Else
MessageRequester("Error", "The 3D Engine can't be initialized",0)
EndIf
End