[updated] Water example (exe and src included)

Share your advanced PureBasic knowledge/code with the community.
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

[updated] Water example (exe and src included)

Post by djes »

Here's a test about the new water "functionality" :D

http://djes.free.fr/purebasic/water_example.zip

Edit : remplaced shaders mapping by a simple UV Mapping, and no antialias.
Last edited by djes on Mon Nov 10, 2008 1:06 am, edited 1 time in total.
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Post by rsts »

WHOA!

Very impressive. Thanks, thanks, thanks

:D
User avatar
idle
Always Here
Always Here
Posts: 5844
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Post by idle »

That's looking pretty good. :D
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

Very nice.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

Very slow (unusable) on my Pentium IV at 2 gHz. I would've expected faster.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Post by djes »

PB wrote:Very slow (unusable) on my Pentium IV at 2 gHz. I would've expected faster.
Could you put your ogre.log here? Thank you.
Note that antialias is set to 2, maybe it's why it's so slow on your computer. I've tested on an athlon 1800, and it was pretty fast (NVidia 6600)
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

> Could you put your ogre.log here?

The new version seems a bit faster. Here's my log:

Code: Select all

12:46:01: Creating resource group General
12:46:01: Creating resource group Internal
12:46:01: Creating resource group Autodetect
12:46:01: SceneManagerFactory for type 'DefaultSceneManager' registered.
12:46:01: Registering ResourceManager for type Material
12:46:01: Registering ResourceManager for type Mesh
12:46:01: Registering ResourceManager for type Skeleton
12:46:01: MovableObjectFactory for type 'ParticleSystem' registered.
12:46:01: OverlayElementFactory for type Panel registered.
12:46:01: OverlayElementFactory for type BorderPanel registered.
12:46:01: OverlayElementFactory for type TextArea registered.
12:46:01: Registering ResourceManager for type Font
12:46:01: ArchiveFactory for archive type FileSystem registered.
12:46:01: ArchiveFactory for archive type Zip registered.
12:46:01: FreeImage version: 3.10.0
12:46:01: This program uses FreeImage, a free, open source image library supporting all common bitmap formats. See http://freeimage.sourceforge.net for details
12:46:01: 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
12:46:01: DDS codec registering
12:46:01: Registering ResourceManager for type HighLevelGpuProgram
12:46:01: Registering ResourceManager for type Compositor
12:46:01: MovableObjectFactory for type 'Entity' registered.
12:46:01: MovableObjectFactory for type 'Light' registered.
12:46:01: MovableObjectFactory for type 'BillboardSet' registered.
12:46:01: MovableObjectFactory for type 'ManualObject' registered.
12:46:01: MovableObjectFactory for type 'BillboardChain' registered.
12:46:01: MovableObjectFactory for type 'RibbonTrail' registered.
12:46:01: OGRE EXCEPTION(6:FileNotFoundException): 'plugins.cfg' file not found! in ConfigFile::load at OgreConfigFile.cpp (line 84)
12:46:01: plugins.cfg not found, automatic plugin loading disabled.
12:46:01: *-*-* OGRE Initialising
12:46:01: *-*-* Version 1.6.0RC1 (Shoggoth)
12:46:01: D3D9 : Direct3D9 Rendering Subsystem created.
12:46:01: D3D9: Driver Detection Starts
12:46:01: D3D9: Driver Detection Ends
12:46:01: Particle Emitter Type 'Point' registered
12:46:01: Particle Emitter Type 'Box' registered
12:46:01: Particle Emitter Type 'Ellipsoid' registered
12:46:01: Particle Emitter Type 'Cylinder' registered
12:46:01: Particle Emitter Type 'Ring' registered
12:46:01: Particle Emitter Type 'HollowEllipsoid' registered
12:46:01: Particle Affector Type 'LinearForce' registered
12:46:01: Particle Affector Type 'ColourFader' registered
12:46:01: Particle Affector Type 'ColourFader2' registered
12:46:01: Particle Affector Type 'ColourImage' registered
12:46:01: Particle Affector Type 'ColourInterpolator' registered
12:46:01: Particle Affector Type 'Scaler' registered
12:46:01: Particle Affector Type 'Rotator' registered
12:46:01: Particle Affector Type 'DirectionRandomiser' registered
12:46:01: Particle Affector Type 'DeflectorPlane' registered
12:46:01: CPU Identifier & Features
12:46:01: -------------------------
12:46:01:  *   CPU ID: GenuineIntel: Intel(R) Pentium(R) 4 CPU 2.00GHz
12:46:01:  *      SSE: yes
12:46:01:  *     SSE2: yes
12:46:01:  *     SSE3: no
12:46:01:  *      MMX: yes
12:46:01:  *   MMXEXT: yes
12:46:01:  *    3DNOW: no
12:46:01:  * 3DNOWEXT: no
12:46:01:  *     CMOV: yes
12:46:01:  *      TSC: yes
12:46:01:  *      FPU: yes
12:46:01:  *      PRO: no
12:46:01:  *       HT: yes
12:46:01: -------------------------
12:46:01: D3D9 : Subsystem Initialising
12:46:01: ***************************************
12:46:01: *** D3D9 : Subsystem Initialised OK ***
12:46:01: ***************************************
12:46:01: SceneManagerFactory for type 'OctreeSceneManager' registered.
12:46:01: SceneManagerFactory for type 'TerrainSceneManager' registered.
12:46:01: SceneManagerFactory for type 'BspSceneManager' registered.
12:46:01: Registering ResourceManager for type BspLevel
12:46:01: Added resource location './test1/' of type 'FileSystem' to resource group 'General'
12:46:01: Added resource location './Water' of type 'FileSystem' to resource group 'General'
12:46:03: D3D9RenderSystem::_createRenderWindow "PureBasic Ogre", 512x384 windowed  miscParams: FSAA=0 externalWindowHandle=2033188
12:46:03: D3D9 : Created D3D9 Rendering Window 'PureBasic Ogre' : 512x384, 32bpp
12:46:03: D3D9 : WARNING - disabling VSync in windowed mode can cause timing issues at lower frame rates, turn VSync on if you observe this problem.
12:46:03: Registering ResourceManager for type Texture
12:46:03: Registering ResourceManager for type GpuProgram
12:46:03: RenderSystem capabilities
12:46:03: -------------------------
12:46:03: RenderSystem Name: Direct3D9 Rendering Subsystem
12:46:03: GPU Vendor: nvidia
12:46:03: Device Name: NVIDIA GeForce FX 5200
12:46:03: Driver Version: 6.14.11.7519
12:46:03:  * Fixed function pipeline: yes
12:46:03:  * Hardware generation of mipmaps: yes
12:46:03:  * Texture blending: yes
12:46:03:  * Anisotropic texture filtering: yes
12:46:03:  * Dot product texture operation: yes
12:46:03:  * Cube mapping: yes
12:46:03:  * Hardware stencil buffer: yes
12:46:03:    - Stencil depth: 8
12:46:03:    - Two sided stencil support: yes
12:46:03:    - Wrap stencil values: yes
12:46:03:  * Hardware vertex / index buffers: yes
12:46:03:  * Vertex programs: yes
12:46:03:  * Fragment programs: yes
12:46:03:  * Supported Shader Profiles: hlsl ps_1_1 ps_1_2 ps_1_3 ps_1_4 ps_2_0 ps_2_a ps_2_x vs_1_1 vs_2_0 vs_2_a vs_2_x
12:46:03:  * Texture Compression: yes
12:46:03:    - DXT: yes
12:46:03:    - VTC: no
12:46:03:  * Scissor Rectangle: yes
12:46:03:  * Hardware Occlusion Query: yes
12:46:03:  * User clip planes: yes
12:46:03:  * VET_UBYTE4 vertex element type: yes
12:46:03:  * Infinite far plane projection: yes
12:46:03:  * Hardware render-to-texture: yes
12:46:03:  * Floating point textures: yes
12:46:03:  * Non-power-of-two textures: yes (limited)
12:46:03:  * Volume textures: yes
12:46:03:  * Multiple Render Targets: 1
12:46:03:    - With different bit depths: no
12:46:03:  * Point Sprites: yes
12:46:03:  * Extended point parameters: yes
12:46:03:  * Max Point Size: 8192
12:46:03:  * Vertex texture fetch: no
12:46:03:  * DirectX per stage constants: yes
12:46:03: ResourceBackgroundQueue - threading disabled
12:46:03: Particle Renderer Type 'billboard' registered
12:46:03: Parsing scripts for resource group Autodetect
12:46:03: Finished parsing scripts for resource group Autodetect
12:46:03: Parsing scripts for resource group General
12:46:03: Parsing script cube.material
12:46:03: Finished parsing scripts for resource group General
12:46:03: Parsing scripts for resource group Internal
12:46:03: Finished parsing scripts for resource group Internal
12:46:03: Mesh: Loading cube.mesh.
12:46:03: WARNING: cube.mesh is an older format ([MeshSerializer_v1.30]); you should upgrade it as soon as possible using the OgreMeshUpgrade tool.
12:46:03: Texture: PureBasicLogo.bmp: Loading 1 faces(PF_R8G8B8,256x256x1) with  hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,256x256x1.
12:46:03: Creating viewport on target 'PureBasic Ogre', rendering from camera 'C0', relative dimensions L: 0.00 T: 0.00 W: 1.00 H: 1.00 ZOrder: 0
12:46:03: [Hydrax] Hydrax object created.
12:46:03: [Hydrax] Creating module.
12:46:03: [Hydrax] Creating ProjectedGrid module.
12:46:03: [Hydrax] ProjectedGrid created.
12:46:03: [Hydrax] Module created.
12:46:03: [Hydrax] Creating RTListeners.
12:46:03: Creating viewport on target 'rtt/2151552/HydraxRefractionMap', rendering from camera 'C0', relative dimensions L: 0.00 T: 0.00 W: 1.00 H: 1.00 ZOrder: 0
12:46:03: Creating viewport on target 'rtt/2152032/HydraxReflectionMap', rendering from camera 'C0', relative dimensions L: 0.00 T: 0.00 W: 1.00 H: 1.00 ZOrder: 0
12:46:03: Creating viewport on target 'rtt/2158336/HydraxDepthMap', rendering from camera 'C0', relative dimensions L: 0.00 T: 0.00 W: 1.00 H: 1.00 ZOrder: 0
12:46:03: [Hydrax] RTListeners created
12:46:03: [Hydrax] Registring device restored listener
12:46:03: [Hydrax] Device restored listener registred
12:46:03: [Hydrax] Creating materials,
12:46:03: [Hydrax] Creating water material...
12:46:03: WARNING: Texture instance 'HydraxReflectionMap' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
12:46:03: WARNING: Texture instance 'HydraxRefractionMap' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
12:46:03: WARNING: Texture instance 'HydraxDepthMap' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
12:46:03: WARNING: Texture instance 'HydraxReflectionMap' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
12:46:03: WARNING: Texture instance 'HydraxRefractionMap' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
12:46:03: WARNING: Texture instance 'HydraxDepthMap' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
12:46:03: Texture: Fresnel.bmp: Loading 1 faces(PF_L8,256x1x1) with 8 generated mipmaps from Image. Internal format is PF_L8,256x1x1.
12:46:03: Texture: Foam.png: Loading 1 faces(PF_R8G8B8,512x512x1) with  hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
12:46:03: [Hydrax] Water material created.
12:46:03: [Hydrax] Creating depth material...
12:46:03: Texture: Caustics_0.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with  hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
12:46:03: Texture: Caustics_1.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with  hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
12:46:03: Texture: Caustics_2.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with  hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
12:46:03: Texture: Caustics_3.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with  hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
12:46:03: Texture: Caustics_4.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with  hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
12:46:03: Texture: Caustics_5.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with  hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
12:46:03: Texture: Caustics_6.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with  hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
12:46:03: Texture: Caustics_7.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with  hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
12:46:03: Texture: Caustics_8.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with  hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
12:46:03: Texture: Caustics_9.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with  hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
12:46:03: Texture: Caustics_10.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with  hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
12:46:03: Texture: Caustics_11.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with  hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
12:46:03: Texture: Caustics_12.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with  hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
12:46:03: Texture: Caustics_13.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with  hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
12:46:03: Texture: Caustics_14.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with  hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
12:46:03: Texture: Caustics_15.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with  hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
12:46:03: Texture: Caustics_16.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with  hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
12:46:03: Texture: Caustics_17.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with  hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
12:46:03: Texture: Caustics_18.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with  hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
12:46:03: Texture: Caustics_19.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with  hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
12:46:03: Texture: Caustics_20.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with  hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
12:46:03: Texture: Caustics_21.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with  hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
12:46:03: Texture: Caustics_22.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with  hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
12:46:03: Texture: Caustics_23.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with  hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
12:46:03: Texture: Caustics_24.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with  hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
12:46:03: Texture: Caustics_25.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with  hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
12:46:03: Texture: Caustics_26.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with  hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
12:46:03: Texture: Caustics_27.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with  hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
12:46:03: Texture: Caustics_28.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with  hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
12:46:03: Texture: Caustics_29.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with  hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
12:46:03: Texture: Caustics_30.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with  hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
12:46:03: Texture: Caustics_31.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with  hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
12:46:03: [Hydrax] Depth material created.
12:46:03: [Hydrax] Materials created.
12:46:03: [Hydrax] Creating water mesh.
12:46:03: WARNING: Mesh instance 'HydraxMesh' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
12:46:03: [Hydrax] Water mesh created
12:46:03: Texture: Skywarp_fr.png: Loading 1 faces(PF_R8G8B8,512x512x1) with  hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
12:46:03: Texture: Skywarp_bk.png: Loading 1 faces(PF_R8G8B8,512x512x1) with  hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
12:46:03: Texture: Skywarp_lf.png: Loading 1 faces(PF_R8G8B8,512x512x1) with  hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
12:46:03: Texture: Skywarp_rt.png: Loading 1 faces(PF_R8G8B8,512x512x1) with  hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
12:46:03: Texture: Skywarp_up.png: Loading 1 faces(PF_R8G8B8,512x512x1) with  hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
12:46:04: Texture: Skywarp_dn.png: Loading 1 faces(PF_R8G8B8,512x512x1) with  hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
User avatar
flaith
Enthusiast
Enthusiast
Posts: 704
Joined: Mon Apr 25, 2005 9:28 pm
Location: $300:20 58 FC 60 - Rennes
Contact:

Post by flaith »

:? doesnt'work for me (Windows XP SP2)

Code: Select all

---------------------------
Microsoft Visual C++ Runtime Library
---------------------------
Runtime Error!

Program: C:\Nico\_PB_\water_example\test.exe

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
“Fear is a reaction. Courage is a decision.” - WC
User avatar
Kukulkan
Addict
Addict
Posts: 1396
Joined: Mon Jun 06, 2005 2:35 pm
Location: germany
Contact:

Post by Kukulkan »

flaith wrote::? doesnt'work for me (Windows XP SP2)

Code: Select all

---------------------------
Microsoft Visual C++ Runtime Library
---------------------------
Runtime Error!

Program: C:\Nico\_PB_\water_example\test.exe

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
Same for me :cry:
XP Prof SP2, SiS Mirage, DX 9.0c

Kukulkan
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Post by djes »

It seems that either your GFX card or driver lacks something for the water to be drawn. Hard for me to say what, even with the Ogre log. I'll create a bug report for Fred.
User avatar
Comtois
Addict
Addict
Posts: 1431
Joined: Tue Aug 19, 2003 11:36 am
Location: Doubs - France

Post by Comtois »

Please correct my english
http://purebasic.developpez.com/
Thalius
Enthusiast
Enthusiast
Posts: 711
Joined: Thu Jul 17, 2003 4:15 pm
Contact:

Post by Thalius »

SiS Mirage has no correct Shader Support.

The Nvidia FX 5200 and 5600 FX Series while suporting vs/ps2.0 are buggy and very very slow in shader processing (learned the hard way).
"In 3D there is never enough Time to do Things right,
but there's always enough Time to make them *look* right."
"psssst! i steal signatures... don't tell anyone! ;)"
Post Reply