Page 1 sur 1

[RESOLU] CreateWater()

Publié : mer. 18/sept./2013 22:23
par falsam
Je me pose des questions sur la création de l'eau.

CreateWater(#Camera, x, y, z, Transparence, Options) permet de créer une surface d'eau.

Pourquoi une camera pour créer l'eau ?

Si je comprend la position y qui va me permettre de positionner l'eau en hauteur, je ne comprend pas par contre la position x et y sachant que la surface est infini.

L'amplitude des vagues peut dépasser par moment les 3 m. Je pensais que le paramétre #PB_World_WaterSmooth allait atténuer cette amplitude mais il n'en est rien. Dans ces condition, créer une plage me parait difficile. ça aurait était pas mal de régler la hauteur des vagues voir meme avoir une eau presque plate.

Le résultat du code qui suit est plutôt laid mais il est là pour illustrer l'amplitude des vagues. Vous allez voir un parallélépipède de 10 m de hauteur plongé dans l'eau. Personne sensible s'abstenir :p

Code : Tout sélectionner

Define CamX.f, CamY.f

InitEngine3D()
InitSprite()
InitKeyboard()
InitMouse()

ExamineDesktops()
WWidth = DesktopWidth(0) 
WHeight = DesktopHeight(0) 

Window = OpenWindow(#PB_Any, 0, 0, WWidth, Wheight, "3d",#PB_Window_ScreenCentered|#PB_Window_SystemMenu)
OpenWindowedScreen(WindowID(Window), 0, 0, WWidth, WHeight, 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) 
    
Camera = CreateCamera(#PB_Any, 0, 0, 100, 100)
MoveCamera(Camera,  0, 30, 80)
CameraLookAt(Camera, 0, 0, 0)

Light = CreateLight(#PB_Any ,RGB(190, 190, 190), 0, 100, 0, #PB_Light_Directional)
     
SkyBox("desert07.jpg")
Sun(10000, 10000, -100000, RGB(238, 173, 148))

CreateWater(Camera, 0, 0, 0, 255, #PB_World_WaterSmooth)

Mesh = CreateCube(#PB_Any, 1)
Entity = CreateEntity(#PB_Any, MeshID(Mesh), #PB_Material_None)
ScaleEntity(Entity, 30, 10, 30)
  
Repeat
   
  If ExamineMouse()
    CamY = -MouseDeltaX()/10 
    CamX = -MouseDeltaY()/10  

  EndIf
   
  RotateCamera(Camera, CamX, CamY, 0, #PB_Relative)
   
  If ExamineKeyboard()       
    If KeyboardPushed(#PB_Key_Escape)
      End
    EndIf  
  EndIf
   
  RenderWorld()
  FlipBuffers()

ForEver

Re: CreateWater()

Publié : jeu. 19/sept./2013 8:02
par blendman
salut

Je ne peux pas tester, car chez moi, lorsque je lance un createWater() sur mon PC, j'ai une IMA.

Voici mon Log Ogre :

Code : Tout sélectionner

09:00:06: Creating resource group General
09:00:06: Creating resource group Internal
09:00:06: Creating resource group Autodetect
09:00:06: SceneManagerFactory for type 'DefaultSceneManager' registered.
09:00:06: Registering ResourceManager for type Material
09:00:06: Registering ResourceManager for type Mesh
09:00:06: Registering ResourceManager for type Skeleton
09:00:06: MovableObjectFactory for type 'ParticleSystem' registered.
09:00:06: OverlayElementFactory for type Panel registered.
09:00:06: OverlayElementFactory for type BorderPanel registered.
09:00:06: OverlayElementFactory for type TextArea registered.
09:00:06: Registering ResourceManager for type Font
09:00:06: ArchiveFactory for archive type FileSystem registered.
09:00:06: ArchiveFactory for archive type Zip registered.
09:00:06: ArchiveFactory for archive type EmbeddedZip registered.
09:00:06: DDS codec registering
09:00:06: FreeImage version: 3.10.0
09:00:06: This program uses FreeImage, a free, open source image library supporting all common bitmap formats. See http://freeimage.sourceforge.net for details
09:00:06: 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
09:00:06: PVRTC codec registering
09:00:06: Registering ResourceManager for type HighLevelGpuProgram
09:00:06: Registering ResourceManager for type Compositor
09:00:06: MovableObjectFactory for type 'Entity' registered.
09:00:06: MovableObjectFactory for type 'Light' registered.
09:00:06: MovableObjectFactory for type 'BillboardSet' registered.
09:00:06: MovableObjectFactory for type 'ManualObject' registered.
09:00:06: MovableObjectFactory for type 'BillboardChain' registered.
09:00:06: MovableObjectFactory for type 'RibbonTrail' registered.
09:00:06: *-*-* OGRE Initialising
09:00:06: *-*-* Version 1.8.2 (Byatis)
09:00:06: OpenGL Rendering Subsystem created.
09:00:07: Particle Emitter Type 'Point' registered
09:00:07: Particle Emitter Type 'Box' registered
09:00:07: Particle Emitter Type 'Ellipsoid' registered
09:00:07: Particle Emitter Type 'Cylinder' registered
09:00:07: Particle Emitter Type 'Ring' registered
09:00:07: Particle Emitter Type 'HollowEllipsoid' registered
09:00:07: Particle Affector Type 'LinearForce' registered
09:00:07: Particle Affector Type 'ColourFader' registered
09:00:07: Particle Affector Type 'ColourFader2' registered
09:00:07: Particle Affector Type 'ColourImage' registered
09:00:07: Particle Affector Type 'ColourInterpolator' registered
09:00:07: Particle Affector Type 'Scaler' registered
09:00:07: Particle Affector Type 'Rotator' registered
09:00:07: Particle Affector Type 'DirectionRandomiser' registered
09:00:07: Particle Affector Type 'DeflectorPlane' registered
09:00:07: PCZone Factory Type 'ZoneType_Default' registered
09:00:07: CPU Identifier & Features
09:00:07: -------------------------
09:00:07:  *   CPU ID: AuthenticAMD: AMD E1-1200 APU with Radeon(tm) HD Graphics
09:00:07:  *      SSE: yes
09:00:07:  *     SSE2: yes
09:00:07:  *     SSE3: yes
09:00:07:  *      MMX: yes
09:00:07:  *   MMXEXT: yes
09:00:07:  *    3DNOW: no
09:00:07:  * 3DNOWEXT: no
09:00:07:  *     CMOV: yes
09:00:07:  *      TSC: yes
09:00:07:  *      FPU: yes
09:00:07:  *      PRO: yes
09:00:07:  *       HT: no
09:00:07: -------------------------
09:00:07: *** Starting Win32GL Subsystem ***
09:00:07: Registering ResourceManager for type Texture
09:00:07: SceneManagerFactory for type 'OctreeSceneManager' registered.
09:00:07: SceneManagerFactory for type 'BspSceneManager' registered.
09:00:07: Registering ResourceManager for type BspLevel
09:00:07: GLRenderSystem::_createRenderWindow "PureBasic Ogre", 1680x1050 windowed  miscParams: FSAA=0 displayFrequency=0 externalWindowHandle=394832 vsync=true 
09:00:07: GL_VERSION = 4.2.11774 Compatibility Profile Context
09:00:07: GL_VENDOR = ATI Technologies Inc.
09:00:07: GL_RENDERER = AMD Radeon HD 7310 Graphics
09:00:07: GL_EXTENSIONS = GL_AMDX_debug_output GL_AMDX_vertex_shader_tessellator GL_AMD_conservative_depth GL_AMD_debug_output GL_AMD_depth_clamp_separate GL_AMD_draw_buffers_blend GL_AMD_multi_draw_indirect GL_AMD_name_gen_delete GL_AMD_performance_monitor GL_AMD_pinned_memory GL_AMD_query_buffer_object GL_AMD_sample_positions GL_AMD_seamless_cubemap_per_texture GL_AMD_shader_stencil_export GL_AMD_shader_trace GL_AMD_texture_cube_map_array GL_AMD_texture_texture4 GL_AMD_transform_feedback3_lines_triangles GL_AMD_vertex_shader_layer GL_AMD_vertex_shader_tessellator GL_AMD_vertex_shader_viewport_index GL_ARB_ES2_compatibility GL_ARB_base_instance GL_ARB_blend_func_extended GL_ARB_color_buffer_float GL_ARB_compressed_texture_pixel_storage GL_ARB_conservative_depth GL_ARB_copy_buffer GL_ARB_depth_buffer_float GL_ARB_depth_clamp GL_ARB_depth_texture GL_ARB_draw_buffers GL_ARB_draw_buffers_blend GL_ARB_draw_elements_base_vertex GL_ARB_draw_indirect GL_ARB_draw_instanced GL_ARB_explicit_attrib_location GL_ARB_fragment_coord_conventions GL_ARB_fragment_program GL_ARB_fragment_program_shadow GL_ARB_fragment_shader GL_ARB_framebuffer_object GL_ARB_framebuffer_sRGB GL_ARB_geometry_shader4 GL_ARB_get_program_binary GL_ARB_gpu_shader5 GL_ARB_gpu_shader_fp64 GL_ARB_half_float_pixel GL_ARB_half_float_vertex GL_ARB_imaging GL_ARB_instanced_arrays GL_ARB_internalformat_query GL_ARB_map_buffer_alignment GL_ARB_map_buffer_range GL_ARB_multisample GL_ARB_multitexture GL_ARB_occlusion_query GL_ARB_occlusion_query2 GL_ARB_pixel_buffer_object GL_ARB_point_parameters GL_ARB_point_sprite GL_ARB_provoking_vertex GL_ARB_sample_shading GL_ARB_sampler_objects GL_ARB_seamless_cube_map GL_ARB_separate_shader_objects GL_ARB_shader_atomic_counters GL_ARB_shader_bit_encoding GL_ARB_shader_image_load_store GL_ARB_shader_objects GL_ARB_shader_precision GL_ARB_shader_stencil_export GL_ARB_shader_subroutine GL_ARB_shader_texture_lod GL_ARB_shading_language_100 GL_ARB_shading_language_420pack GL_ARB_shading_language_packing GL_ARB_shadow GL_ARB_shadow_ambient GL_ARB_sync GL_ARB_tessellation_shader GL_ARB_texture_border_clamp GL_ARB_texture_buffer_object GL_ARB_texture_buffer_object_rgb32 GL_ARB_texture_compression GL_ARB_texture_compression_bptc GL_ARB_texture_compression_rgtc GL_ARB_texture_cube_map GL_ARB_texture_cube_map_array GL_ARB_texture_env_add GL_ARB_texture_env_combine GL_ARB_texture_env_crossbar GL_ARB_texture_env_dot3 GL_ARB_texture_float GL_ARB_texture_gather GL_ARB_texture_mirrored_repeat GL_ARB_texture_multisample GL_ARB_texture_non_power_of_two GL_ARB_texture_query_lod GL_ARB_texture_rectangle GL_ARB_texture_rg GL_ARB_texture_rgb10_a2ui GL_ARB_texture_snorm GL_ARB_texture_storage GL_ARB_timer_query GL_ARB_transform_feedback2 GL_ARB_transform_feedback3 GL_ARB_transform_feedback_instanced GL_ARB_transpose_matrix GL_ARB_uniform_buffer_object GL_ARB_vertex_array_bgra GL_ARB_vertex_array_object GL_ARB_vertex_attrib_64bit GL_ARB_vertex_buffer_object GL_ARB_vertex_program GL_ARB_vertex_shader GL_ARB_vertex_type_2_10_10_10_rev GL_ARB_viewport_array GL_ARB_window_pos GL_ATI_draw_buffers GL_ATI_envmap_bumpmap GL_ATI_fragment_shader GL_ATI_meminfo GL_ATI_separate_stencil GL_ATI_texture_compression_3dc GL_ATI_texture_env_combine3 GL_ATI_texture_float GL_ATI_texture_mirror_once GL_EXT_abgr GL_EXT_bgra GL_EXT_bindable_uniform GL_EXT_blend_color GL_EXT_blend_equation_separate GL_EXT_blend_func_separate GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_compiled_vertex_array GL_EXT_copy_buffer GL_EXT_copy_texture GL_EXT_direct_state_access GL_EXT_draw_buffers2 GL_EXT_draw_instanced GL_EXT_draw_range_elements GL_EXT_fog_coord GL_EXT_framebuffer_blit GL_EXT_framebuffer_multisample GL_EXT_framebuffer_object GL_EXT_framebuffer_sRGB GL_EXT_geometry_shader4 GL_EXT_gpu_program_parameters GL_EXT_gpu_shader4 GL_EXT_histogram GL_EXT_multi_draw_arrays GL_EXT_packed_depth_stencil GL_EXT_packed_float GL_EXT_packed_pixels GL_EXT_pixel_buffer_object GL_EXT_point_parameters GL_EXT_provoking_vertex GL_EXT_rescale_normal GL_EXT_secondary_color GL_EXT_separate_specular_color GL_EXT_shader_image_load_store GL_EXT_shadow_funcs GL_EXT_stencil_wrap GL_EXT_subtexture GL_EXT_texgen_reflection GL_EXT_texture3D GL_EXT_texture_array GL_EXT_texture_buffer_object GL_EXT_texture_compression_bptc GL_EXT_texture_compression_latc GL_EXT_texture_compression_rgtc GL_EXT_texture_compression_s3tc GL_EXT_texture_cube_map GL_EXT_texture_edge_clamp GL_EXT_texture_env_add GL_EXT_texture_env_combine GL_EXT_texture_env_dot3 GL_EXT_texture_filter_anisotropic GL_EXT_texture_integer GL_EXT_texture_lod GL_EXT_texture_lod_bias GL_EXT_texture_mirror_clamp GL_EXT_texture_object GL_EXT_texture_rectangle GL_EXT_texture_sRGB GL_EXT_texture_sRGB_decode GL_EXT_texture_shared_exponent GL_EXT_texture_snorm GL_EXT_texture_storage GL_EXT_texture_swizzle GL_EXT_timer_query GL_EXT_transform_feedback GL_EXT_vertex_array GL_EXT_vertex_array_bgra GL_EXT_vertex_attrib_64bit GL_IBM_texture_mirrored_repeat GL_KTX_buffer_region GL_NV_blend_square GL_NV_conditional_render GL_NV_copy_depth_to_color GL_NV_copy_image GL_NV_explicit_multisample GL_NV_float_buffer GL_NV_half_float GL_NV_primitive_restart GL_NV_texgen_reflection GL_NV_texture_barrier GL_SGIS_generate_mipmap GL_SGIS_texture_edge_clamp GL_SGIS_texture_lod GL_SUN_multi_draw_arrays GL_WIN_swap_hint WGL_EXT_swap_control
09:00:07: Supported WGL extensions: WGL_ARB_extensions_string WGL_ARB_pixel_format WGL_ATI_pixel_format_float WGL_ARB_pixel_format_float WGL_ARB_multisample WGL_EXT_swap_control WGL_EXT_swap_control_tear WGL_ARB_pbuffer WGL_ARB_render_texture WGL_ARB_make_current_read WGL_EXT_extensions_string WGL_ARB_buffer_region WGL_EXT_framebuffer_sRGB WGL_ATI_render_texture_rectangle WGL_EXT_pixel_format_packed_float WGL_I3D_genlock WGL_NV_swap_group WGL_ARB_create_context WGL_AMD_gpu_association WGL_AMDX_gpu_association WGL_ARB_create_context_profile WGL_NV_float_buffer
09:00:07: ***************************
09:00:07: *** GL Renderer Started ***
09:00:07: ***************************
09:00:07: Registering ResourceManager for type GpuProgram
09:00:07: GLSL support detected
09:00:07: GL: Using GL_EXT_framebuffer_object for rendering to textures (best)
09:00:07: FBO PF_UNKNOWN depth/stencil support: D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8 
09:00:07: FBO PF_L8 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8 
09:00:07: FBO PF_L16 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8 
09:00:07: FBO PF_A8 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8 
09:00:07: FBO PF_A4L4 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8 
09:00:07: FBO PF_BYTE_LA depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8 
09:00:07: FBO PF_R5G6B5 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8 
09:00:07: FBO PF_B5G6R5 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8 
09:00:07: FBO PF_A4R4G4B4 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8 
09:00:07: FBO PF_A1R5G5B5 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8 
09:00:07: FBO PF_R8G8B8 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8 
09:00:07: FBO PF_B8G8R8 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8 
09:00:07: FBO PF_A8R8G8B8 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8 
09:00:07: FBO PF_B8G8R8A8 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8 
09:00:07: FBO PF_A2R10G10B10 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8 
09:00:07: FBO PF_A2B10G10R10 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8 
09:00:08: FBO PF_FLOAT16_RGB depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8 
09:00:08: FBO PF_FLOAT16_RGBA depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8 
09:00:08: FBO PF_FLOAT32_RGB depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8 
09:00:08: FBO PF_FLOAT32_RGBA depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8 
09:00:08: FBO PF_X8R8G8B8 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8 
09:00:08: FBO PF_X8B8G8R8 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8 
09:00:08: FBO PF_SHORT_RGBA depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8 
09:00:08: FBO PF_R3G3B2 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8 
09:00:08: FBO PF_FLOAT16_R depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8 
09:00:08: FBO PF_FLOAT32_R depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8 
09:00:08: FBO PF_SHORT_GR depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8 
09:00:08: FBO PF_FLOAT16_GR depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8 
09:00:08: FBO PF_FLOAT32_GR depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8 
09:00:08: FBO PF_SHORT_RGB depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8 
09:00:08: [GL] : Valid FBO targets PF_UNKNOWN PF_L8 PF_L16 PF_A8 PF_A4L4 PF_BYTE_LA PF_R5G6B5 PF_B5G6R5 PF_A4R4G4B4 PF_A1R5G5B5 PF_R8G8B8 PF_B8G8R8 PF_A8R8G8B8 PF_B8G8R8A8 PF_A2R10G10B10 PF_A2B10G10R10 PF_FLOAT16_RGB PF_FLOAT16_RGBA PF_FLOAT32_RGB PF_FLOAT32_RGBA PF_X8R8G8B8 PF_X8B8G8R8 PF_SHORT_RGBA PF_R3G3B2 PF_FLOAT16_R PF_FLOAT32_R PF_SHORT_GR PF_FLOAT16_GR PF_FLOAT32_GR PF_SHORT_RGB 
09:00:08: RenderSystem capabilities
09:00:08: -------------------------
09:00:08: RenderSystem Name: OpenGL Rendering Subsystem
09:00:08: GPU Vendor: ati
09:00:08: Device Name: AMD Radeon HD 7310 Graphics
09:00:08: Driver Version: 4.2.11774.0
09:00:08:  * Fixed function pipeline: yes
09:00:08:  * Hardware generation of mipmaps: yes
09:00:08:  * Texture blending: yes
09:00:08:  * Anisotropic texture filtering: yes
09:00:08:  * Dot product texture operation: yes
09:00:08:  * Cube mapping: yes
09:00:08:  * Hardware stencil buffer: yes
09:00:08:    - Stencil depth: 8
09:00:08:    - Two sided stencil support: yes
09:00:08:    - Wrap stencil values: yes
09:00:08:  * Hardware vertex / index buffers: yes
09:00:08:  * Vertex programs: yes
09:00:08:  * Number of floating-point constants for vertex programs: 256
09:00:08:  * Number of integer constants for vertex programs: 0
09:00:08:  * Number of boolean constants for vertex programs: 0
09:00:08:  * Fragment programs: yes
09:00:08:  * Number of floating-point constants for fragment programs: 256
09:00:08:  * Number of integer constants for fragment programs: 0
09:00:08:  * Number of boolean constants for fragment programs: 0
09:00:08:  * Geometry programs: yes
09:00:08:  * Number of floating-point constants for geometry programs: 16384
09:00:08:  * Number of integer constants for geometry programs: 0
09:00:08:  * Number of boolean constants for geometry programs: 0
09:00:08:  * Supported Shader Profiles: arbfp1 arbvp1 glsl gp4gp gpu_gp nvgp4 ps_1_1 ps_1_2 ps_1_3 ps_1_4
09:00:08:  * Texture Compression: yes
09:00:08:    - DXT: yes
09:00:08:    - VTC: no
09:00:08:    - PVRTC: no
09:00:08:  * Scissor Rectangle: yes
09:00:08:  * Hardware Occlusion Query: yes
09:00:08:  * User clip planes: yes
09:00:08:  * VET_UBYTE4 vertex element type: yes
09:00:08:  * Infinite far plane projection: yes
09:00:08:  * Hardware render-to-texture: yes
09:00:08:  * Floating point textures: yes
09:00:08:  * Non-power-of-two textures: yes
09:00:08:  * Volume textures: yes
09:00:08:  * Multiple Render Targets: 8
09:00:08:    - With different bit depths: yes
09:00:08:  * Point Sprites: yes
09:00:08:  * Extended point parameters: yes
09:00:08:  * Max Point Size: 8192
09:00:08:  * Vertex texture fetch: yes
09:00:08:  * Number of world matrices: 0
09:00:08:  * Number of texture units: 16
09:00:08:  * Stencil buffer depth: 8
09:00:08:  * Number of vertex blend matrices: 0
09:00:08:    - Max vertex textures: 16
09:00:08:    - Vertex textures shared: yes
09:00:08:  * Render to Vertex Buffer : no
09:00:08:  * GL 1.5 without VBO workaround: no
09:00:08:  * Frame Buffer objects: yes
09:00:08:  * Frame Buffer objects (ARB extension): no
09:00:08:  * Frame Buffer objects (ATI extension): no
09:00:08:  * PBuffer support: yes
09:00:08:  * GL 1.5 without HW-occlusion workaround: no
09:00:08:  * Separate shader objects: no
09:00:08: DefaultWorkQueue('Root') initialising on thread main.
09:00:08: Particle Renderer Type 'billboard' registered
09:00:08: Added resource location 'D:\Programs\utiles\dev\PureBasic\PureBasic5.20LTS\/Examples/3D/Data//Packs/desert.zip' of type 'Zip' to resource group 'General'
09:00:08: Added resource location 'D:\Programs\utiles\dev\PureBasic\PureBasic5.20LTS\/Examples/3D/Data/Water' of type 'FileSystem' to resource group 'General'
09:00:08: Texture: desert07_fr.jpg: Loading 1 faces(PF_R8G8B8,512x512x1) with 9 hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
09:00:08: Texture: desert07_bk.jpg: Loading 1 faces(PF_R8G8B8,512x512x1) with 9 hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
09:00:08: Texture: desert07_lf.jpg: Loading 1 faces(PF_R8G8B8,512x512x1) with 9 hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
09:00:08: Texture: desert07_rt.jpg: Loading 1 faces(PF_R8G8B8,512x512x1) with 9 hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
09:00:08: Texture: desert07_up.jpg: Loading 1 faces(PF_R8G8B8,512x512x1) with 9 hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
09:00:08: Texture: desert07_dn.jpg: Loading 1 faces(PF_R8G8B8,512x512x1) with 9 hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
09:00:08: [Hydrax] Hydrax created.
09:00:08: [Hydrax] Creating module...
09:00:08: [Hydrax] Creating ProjectedGridVertex module.
09:00:08: [Hydrax] ProjectedGridVertex created.
09:00:08: [Hydrax] Module created.
09:00:08: [Hydrax] Initializating RTT Manager...
09:00:08: [Hydrax] RTT manager initialized.
09:00:08: [Hydrax] Registring device restored listener...
09:00:08: [Hydrax] Device restored listener registred.
09:00:08: [Hydrax] Creating materials...
09:00:08: [Hydrax] Creating water material...
09:00:08: Texture: Fresnel.bmp: Loading 1 faces(PF_L8,256x1x1) with 8 hardware generated mipmaps from Image. Internal format is PF_L8,256x1x1.
09:00:08: [Hydrax] Water material created.
09:00:08: [Hydrax] Creating depth material...
09:00:08: OGRE EXCEPTION(2:InvalidParametersException): Parameter called uWorld does not exist.  in GpuProgramParameters::_findNamedConstantDefinition at OgreGpuProgramParams.cpp (line 1451)
J'ai testé aussi en directX, j'ai le même problème.
D'ailleurs, certaines scène 3D ne passent qu'en openGl (createterrain() par exemple)

Re: CreateWater()

Publié : jeu. 19/sept./2013 9:36
par falsam
Comme tu as pu le voir dans ce code, les ressources sont ceux figurant dans les exemples figurant dans le dossier d'installation de Pure Basic. Le code est compilé x86 et s'exécute sous Windows 7. Je n'ai pas testé sous Windows 8.

Ceci dit tu as peut être des réponses á mes questions ?

Re: CreateWater()

Publié : jeu. 19/sept./2013 9:48
par Micoute
Bonjour falsam, chez moi, ça marche nickel (W7 x64)

Re: CreateWater()

Publié : jeu. 19/sept./2013 10:10
par Ar-S
Marche en PB 5.20 x86 sur W8x64

Tu devrais ajouter un |#PB_World_WaterFoam à ton createwater, on se rend vraiment mieux compte du soucis.
Ce qui me fait dire que j'ai l'impression que ta caméra est ton univers sont trop "petit" d’où cet effet de haute vague.
Avec un cube beaucoup plus gros et une caméra plus lointaine ça devrait mieux passer.

En 3D on évite de bosser avec des mètres lors du modeling, question de ressource, mais pour ce qui est d'une scène avec de l'eau, je pense que la position de la cam importe beaucoup tout comme la taille de ton cube. Je dis peut-être des conneries car la 3D de PB je n'ai pas encore tâté mais en modifiant les valeurs comme ci dessous, ça passe déjà mieux.

Code : Tout sélectionner

Define CamX.f, CamY.f

InitEngine3D()
InitSprite()
InitKeyboard()
InitMouse()

ExamineDesktops()
WWidth = DesktopWidth(0) 
WHeight = DesktopHeight(0) 

Window = OpenWindow(#PB_Any, 0, 0, WWidth, Wheight, "3d",#PB_Window_ScreenCentered|#PB_Window_SystemMenu)
OpenWindowedScreen(WindowID(Window), 0, 0, WWidth, WHeight, 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) 
		
Camera = CreateCamera(#PB_Any, 0, 0, 100, 100)
MoveCamera(Camera,  0, 160, 450)
CameraLookAt(Camera, 0, 0, 0)

Light = CreateLight(#PB_Any ,RGB(190, 190, 190), 0, 100, 0, #PB_Light_Directional)
			
SkyBox("desert07.jpg")
Sun(10000, 10000, -100000, RGB(238, 173, 148))

CreateWater(Camera, 0, 0, 0, 255, #PB_World_WaterSmooth|#PB_World_WaterFoam)

Mesh = CreateCube(#PB_Any, 3)
Entity = CreateEntity(#PB_Any, MeshID(Mesh), #PB_Material_None)
ScaleEntity(Entity, 30, 10, 30)
	
Repeat
		
	If ExamineMouse()
		CamY = -MouseDeltaX()/10 
		CamX = -MouseDeltaY()/10  

	EndIf
		
	RotateCamera(Camera, CamX, CamY, 0, #PB_Relative)
		
	If ExamineKeyboard()       
		If KeyboardPushed(#PB_Key_Escape)
			End
		EndIf  
	EndIf
		
	RenderWorld()
	FlipBuffers()

ForEver

---edit---

Je trouve étrange le retour des path : #PB_Compiler_Home +

Code : Tout sélectionner

Debug #PB_Compiler_Home + "/Examples/3D/Data/Packs/desert.zip"

Re: CreateWater()

Publié : jeu. 19/sept./2013 12:05
par falsam
Ar-S a écrit :Ce qui me fait dire que j'ai l'impression que ta caméra est ton univers sont trop "petit" d’où cet effet de haute vague. Avec un cube beaucoup plus gros et une caméra plus lointaine ça devrait mieux passer. En 3D on évite de bosser avec des mètres lors du modeling
Aieeee !!! C'est une réponse que je redoutais. J'ai eu la même réflexion hier soir.

j'ai crée une scène en tenant compte des différents conseils que j'ai pu lire sur ce forum. Un de ces conseil est celui de G-Rom
G-Rom a écrit :... tu peu jouer avec, n'oublie pas qu'une unité fait 1 mètre , essaye de jouer avec des unité un petit peu plus petite.
J'ai un ours dans une scene dont la taille fait 3m, érrant sur une île et que je suis avec CameraFollow(). Si je place la caméra à 160 sur l'axe y comme tu le fais sur ton code, tu te doutes bien qu'on ne verra plus mon ours.

Merci de ta réflexion sur ce sujet qui confirme ce que je craignais. :)
Ar-S a écrit :Je trouve étrange le retour des path : #PB_Compiler_Home +
D'autant plus étrange que ça fonctionne quand même :p Je corrige le code :)

Je réitère mes deux questions figurant sur le premier message.

■ Pourquoi préciser le paramètre caméra lors de la création de l'eau ?
■ Pourquoi définir la position x et y lors de la création de l'eau ?

Re: CreateWater()

Publié : jeu. 19/sept./2013 17:58
par comtois
falsam a écrit :Je réitère mes deux questions figurant sur le premier message.

■ Pourquoi préciser le paramètre caméra lors de la création de l'eau ?
Parce que la lib Hydrax a besoin d'un pointeur vers une caméra.
■ Pourquoi définir la position x et y lors de la création de l'eau ?
Parce que la lib Hydrax a besoin d'un vecteur pour indiquer la position.

Re: CreateWater()

Publié : jeu. 19/sept./2013 21:06
par falsam
Merci Comtois. Contraintes liées à Hydrax. Sujet résolu parce qu'on ne peut rien y faire :)