Page 1 of 1

[updated] Water example (exe and src included)

Posted: Sat Nov 08, 2008 6:55 pm
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.

Posted: Sat Nov 08, 2008 8:02 pm
by rsts
WHOA!

Very impressive. Thanks, thanks, thanks

:D

Posted: Sun Nov 09, 2008 1:59 am
by idle
That's looking pretty good. :D

Posted: Sun Nov 09, 2008 11:06 pm
by DoubleDutch
Very nice.

Posted: Sun Nov 09, 2008 11:09 pm
by PB
Very slow (unusable) on my Pentium IV at 2 gHz. I would've expected faster.

Posted: Mon Nov 10, 2008 12:31 am
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)

Posted: Mon Nov 10, 2008 2:47 am
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.

Posted: Mon Nov 10, 2008 8:13 am
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.

Posted: Mon Nov 10, 2008 9:53 am
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

Posted: Mon Nov 10, 2008 1:10 pm
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.

Posted: Mon Nov 10, 2008 2:08 pm
by Comtois

Posted: Mon Nov 10, 2008 2:27 pm
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).