Landscape v5

Everything related to 3D programming
User avatar
DK_PETER
Addict
Addict
Posts: 898
Joined: Sat Feb 19, 2011 10:06 am
Location: Denmark
Contact:

Re: Landscape v5

Post by DK_PETER »

@kurzer
The problem seems to be with the Ogre3D engine (InitEngine()) and OpenGL.
Granted..I don't know why it throws an error in pf_shadoko's code
but then again - I don't understand his programming tweaks and
usage of constants numbers...It looks great, though. :-D
Luckily for me..I do most of my objects using 3D software.

This code works...But Initialize the 3Dengine and RenderWorld() and the sprite
isn't shown anymore.

Code: Select all

;InitEngine3D()
InitSprite()
InitKeyboard()

OpenWindow(0,  0, 0, 300, 300, "OpenGL Sprite", #PB_Window_ScreenCentered|#PB_Window_SystemMenu)
OpenWindowedScreen(WindowID(0), 0, 0, 300, 300)
CreateSprite(0, 50, 50, #PB_Sprite_AlphaBlending)
StartDrawing(SpriteOutput(0))
DrawingMode(#PB_2DDrawing_AlphaBlend)
Circle(25, 25, 20, $FF00FFFF)
StopDrawing()
Quit = #False

Repeat
  Repeat 
    ev = WindowEvent() 
    If ev = #PB_Event_CloseWindow : quit = #True : EndIf  
  Until  ev = 0
  ;RenderWorld()
  DisplaySprite(0, 0, 0)
  FlipBuffers()
  ExamineKeyboard()
  
Until  KeyboardPushed(#PB_Key_Escape) Or quit = #True
The other question I leave to the team. :-)
Current configurations:
Ubuntu 20.04/64 bit - Window 10 64 bit
Intel 6800K, GeForce Gtx 1060, 32 gb ram.
Amd Ryzen 9 5950X, GeForce 3070, 128 gb ram.
User avatar
pf shadoko
Enthusiast
Enthusiast
Posts: 291
Joined: Thu Jul 09, 2015 9:07 am

Re: Landscape v5

Post by pf shadoko »

@ DK_PETER:
good job, you should put this post in the Bug Reports forum.

@ Kurzer
if you set the library subsystem field blank, it doesn't work ?
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Landscape v5

Post by IdeasVacuum »

As per applePi's comment, I think you can have more than one DX version installed, then specify which to use as a subsystem in PB's Compiler options? Of course, your choice also needs to be inline with what the App needs to run.

OpenGL should work shouldn't it? Always nice if possible because you can use the OGL Gadget and thus have a very tidy Windowed GUI.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
DK_PETER
Addict
Addict
Posts: 898
Joined: Sat Feb 19, 2011 10:06 am
Location: Denmark
Contact:

Re: Landscape v5

Post by DK_PETER »

pf shadoko wrote:@ DK_PETER:
you should put this post in the Bug Reports forum.
Done..

@pf_shadoko
Btw...What are you doing in this line?

Code: Select all

DisableDebugger:SetMaterialAttribute(1,21,3):EnableDebugger

With debugger on it produces an error.
Current configurations:
Ubuntu 20.04/64 bit - Window 10 64 bit
Intel 6800K, GeForce Gtx 1060, 32 gb ram.
Amd Ryzen 9 5950X, GeForce 3070, 128 gb ram.
User avatar
Kurzer
Enthusiast
Enthusiast
Posts: 666
Joined: Sun Jun 11, 2006 12:07 am
Location: Near Hamburg

Re: Landscape v5

Post by Kurzer »

pf shadoko wrote:@ Kurzer
if you set the library subsystem field blank, it doesn't work ?
Yes, exact. I got the error: " InitEngine3D() must be called successfully before the 3D function set is used."
So I suspect that PB tries to use Direct X9 only when the subsystem field is empty.

Since I don't do 3D things on this PC, I will not install DX9 additionally to avoid possible problems.
I have already seen your code running impressively using OpenGL subsystem. :wink:
PB 6.02 x64, OS: Win 7 Pro x64 & Win 11 x64, Desktopscaling: 125%, CPU: I7 6500, RAM: 16 GB, GPU: Intel Graphics HD 520, User age in 2024: 56y
"Happiness is a pet." | "Never run a changing system!"
User avatar
pf shadoko
Enthusiast
Enthusiast
Posts: 291
Joined: Thu Jul 09, 2015 9:07 am

Re: Landscape v5

Post by pf shadoko »

@ DK_PETER:
that's a good question
the 5.71 wasn't supposed to bring anything new, only a bug fix.
but I had added some new 3D features by mistake to the 5.7x branch instead of the 5.8x.
Luckily they were integrated into 5.71.
so there are some new features that are not yet described in the doc.
SetMaterialAttribute (1,21,3)
matches:
SetMaterialAttribute (1,#PB_Material_VertexColourTracking,#TVC_AMBIENT+#TVC_DIFFUSE)
in short, it allows a good coloration at the level of the vertex.
(there will be a lot of 3D new features in 5.80)

@ Kurzer:
curious, I tested my code on machines with windows 7 and 10 without any problem (and without installing DX9)
User avatar
Kurzer
Enthusiast
Enthusiast
Posts: 666
Joined: Sun Jun 11, 2006 12:07 am
Location: Near Hamburg

Re: Landscape v5

Post by Kurzer »

That's interesting. This means your code was running on your machine with an empty field subsystem (in compiler options) and a DirectX version <> 9?
Could this then be a bug that PB is not accessing my DX11? What do you think?

Edit: Hmm, the current manual for 5.72 b1 says that DirectX 9.0 is necessary:

Code: Select all

"For many graphic functions like 3D or Sprites there is needed the DirectX9.0c version. Windows Vista and later don't have installed this from start, so it need to be installed manually."
That makes it even more strange that the code runs without DX 9.0 on your machine.
PB 6.02 x64, OS: Win 7 Pro x64 & Win 11 x64, Desktopscaling: 125%, CPU: I7 6500, RAM: 16 GB, GPU: Intel Graphics HD 520, User age in 2024: 56y
"Happiness is a pet." | "Never run a changing system!"
User avatar
pf shadoko
Enthusiast
Enthusiast
Posts: 291
Joined: Thu Jul 09, 2015 9:07 am

Re: Landscape v5

Post by pf shadoko »

I don't know much about graphic subsystems, but I can guarantee that I have tested my demos on several machines without installing any special version of DX, just PB.
User avatar
DK_PETER
Addict
Addict
Posts: 898
Joined: Sat Feb 19, 2011 10:06 am
Location: Denmark
Contact:

Re: Landscape v5

Post by DK_PETER »

@pf_shadoko
Thank you for explaining. I think I'll start playing with the constants a bit.
Looking eagerly forward to the new 3D features and your
very interesting code examples. :wink:
Current configurations:
Ubuntu 20.04/64 bit - Window 10 64 bit
Intel 6800K, GeForce Gtx 1060, 32 gb ram.
Amd Ryzen 9 5950X, GeForce 3070, 128 gb ram.
Simo_na
Enthusiast
Enthusiast
Posts: 177
Joined: Sun Mar 03, 2013 9:01 am

Re: Landscape v5

Post by Simo_na »

Hi
in PB this run fine....

but

i've compiled to a normal EXE
in EXE don't run

For Run correctly put Engine3d.dll into the folder with the EXE
User avatar
Psychophanta
Addict
Addict
Posts: 4997
Joined: Wed Jun 11, 2003 9:33 pm
Location: Lípetsk, Russian Federation
Contact:

Re: Landscape v5

Post by Psychophanta »

[PB6.10] Info is not displayed at top-left corner of screen
http://www.zeitgeistmovie.com

While world=business:world+mafia:Wend
Will never leave this forum until the absolute bugfree PB :mrgreen:
BarryG
Addict
Addict
Posts: 3324
Joined: Thu Apr 18, 2019 8:17 am

Re: Landscape v5

Post by BarryG »

Fantastic update, but the info box at top-left doesn't show any text for me.
User avatar
minimy
Enthusiast
Enthusiast
Posts: 349
Joined: Mon Jul 08, 2013 8:43 pm

Re: Landscape v5

Post by minimy »

Fantastic demo!! Thanks a lot for share pf shadoko!
+1
If translation=Error: reply="Sorry, Im Spanish": Endif
spacebuddy
Enthusiast
Enthusiast
Posts: 347
Joined: Thu Jul 02, 2009 5:42 am

Re: Landscape v5

Post by spacebuddy »

Very impressive!!
AZJIO
Addict
Addict
Posts: 1360
Joined: Sun May 14, 2017 1:48 am

Re: Landscape v5

Post by AZJIO »

Very impressive examples (ocean, landscape, airplane). Is there any OS dependency? I compiled it to show what cool things there are on the forum, but not everyone worked.

This was compiled on someone else’s computer, but I ran it on mine. Ocean and Airplane gave this error. (Win10-x64)
error screenshot
Now it’s clear that the problem is in using #PB_Compiler_Home
Post Reply