PureBasic Forum
https://www.purebasic.fr/english/

OpenGL & CreateWater()
https://www.purebasic.fr/english/viewtopic.php?f=4&t=73204
Page 1 of 1

Author:  falsam [ Tue Jul 16, 2019 3:54 pm ]
Post subject:  OpenGL & CreateWater()

[5.71 Beta2 LTS (x64)] - Windows 10

Water creation does not work with the OpenGL subsystem.
Code:
EnableExplicit

Define Camera

InitEngine3D(#PB_Engine3D_DebugLog)
InitSprite()
InitKeyboard()

OpenWindow(0, 0, 0, 1024, 768, "Create Water", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0), 0, 0, 1024, 768, 0, 0, 0)

Add3DArchive(#PB_Compiler_Home + "Examples/3D/Data/Packs/desert.zip", #PB_3DArchive_Zip)
Add3DArchive(#PB_Compiler_Home + "examples/3d/Data/Water/", #PB_3DArchive_FileSystem)
Parse3DScripts() 

Camera = CreateCamera(#PB_Any, 0, 0, 100, 100)
MoveCamera(Camera, 0, 100, 200)
CameraLookAt(Camera, 0, 70, 0)

CreateLight(#PB_Any, RGB(255, 255, 255), 1000, 1000, -500)

SkyBox("desert07.jpg")

WorldShadows(#PB_Shadow_TextureAdditive, 1024, RGB(150, 150, 150))

CreateWater(Camera, 0, -17.5, 0, 0, #PB_World_WaterLowQuality | #PB_World_WaterSmooth | #PB_World_WaterSun)

Repeat
  ExamineKeyboard()   
  RenderWorld() 
  FlipBuffers()
Until WindowEvent() = #PB_Event_CloseWindow Or KeyboardReleased(#PB_Key_Escape)
Quote:
16:48:15: [Hydrax] Hydrax created.
16:48:15: [Hydrax] Creating module...
16:48:15: [Hydrax] Creating ProjectedGridVertex module.
16:48:15: [Hydrax] ProjectedGridVertex created.
16:48:15: [Hydrax] Module created.
16:48:15: [Hydrax] Initializating RTT Manager...
16:48:15: [Hydrax] RTT manager initialized.
16:48:15: [Hydrax] Registring device restored listener...
16:48:15: [Hydrax] Device restored listener registred.
16:48:15: [Hydrax] Creating materials...
16:48:15: [Hydrax] Creating water material...
16:48:15: Texture: Fresnel.bmp: Loading 1 faces(PF_L8,256x1x1) with 8 hardware generated mipmaps from Image. Internal format is PF_L8,256x1x1.
16:48:15: [Hydrax] Water material created.
16:48:15: [Hydrax] Creating depth material...
16:48:15: OGRE EXCEPTION(2:InvalidParametersException): Parameter called uWorld does not exist. in GpuProgramParameters::_findNamedConstantDefinition at OgreGpuProgramParams.cpp (line 1451)

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/