PB 6.00 - Shader : Afficher une couleur

Généralités sur la programmation 3D
Avatar de l’utilisateur
falsam
Messages : 7244
Inscription : dim. 22/août/2010 15:24
Localisation : IDF (Yvelines)
Contact :

PB 6.00 - Shader : Afficher une couleur

Message par falsam »

@Guillot : J'ai voulu afficher une couleur avec un shader (Il y a bien plus simple que l'utilisation des shaders) pour voir si on observe le même genre de bug que je rencontre avec tes exemples.

Voici le code en espérant que la façon de faire est la bonne car j'avoue que je suis dérouté par ces nouvelles fonctionnalités 3D.

Code : Tout sélectionner

EnableExplicit

Define Material

InitEngine3D(#PB_Engine3D_DebugLog) : InitSprite() : InitKeyboard() : InitMouse()

ExamineDesktops()
OpenWindow(0, 0,0, DesktopWidth(0)*0.5,DesktopHeight(0)*0.5, "Shader - [Esc] quit",#PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0), 0, 0, WindowWidth(0), WindowHeight(0), 0, 0, 0)

CreateCamera(0, 0, 0, 100, 100) : MoveCamera(0,0,3,-6) : CameraLookAt(0,0,0,0)
CameraBackColor(0,$444488)

CreateLight(0, $ffffff, -10, 10, 0)

Material = CreateShaderMaterial(#PB_Any, #PB_Material_ColorShader)
SetMaterialColor(Material, #PB_Material_DiffuseColor, RGB(154, 205, 50))

CreateCube(0, 2)
CreateEntity(0, MeshID(0), MaterialID(Material))

Repeat
  While WindowEvent() : Wend
  ExamineKeyboard()
  ExamineMouse()
  
  RotateEntity(0, 0.2, 0.2, 0.2, #PB_Relative)
  
  RenderWorld()
  FlipBuffers()    
Until KeyboardReleased(#PB_Key_Escape) Or MouseButton(#PB_MouseButton_Middle)
Le résultat ? le même bug que celui évoqué dans tes exemples.
Configuration : Windows 11 Famille 64-bit - PB 6.03 x64 - AMD Ryzen 7 - 16 GO RAM
Vidéo NVIDIA GeForce GTX 1650 Ti - Résolution 1920x1080 - Mise à l'échelle 125%
Avatar de l’utilisateur
Guillot
Messages : 527
Inscription : jeu. 25/juin/2015 16:18

Re: PB 6.00 - Shader : Afficher une couleur

Message par Guillot »

ta façon de faire est correcte

ci dessous un exemple pour comparer l'ombrage standard avec l'ombrage perpixel

Code : Tout sélectionner

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

ExamineDesktops()
OpenWindow(0, 0,0, DesktopWidth(0)*0.8,DesktopHeight(0)*0.8, "Shader - [Esc] quit",#PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0), 0, 0, WindowWidth(0), WindowHeight(0), 0, 0, 0)

CreateCamera(0, 0, 0, 100, 100) : MoveCamera(0,0,3,-8) : CameraLookAt(0,0,0,0)
CameraBackColor(0,$444488)
AmbientColor($444444)

CreateLight(0, $ffffff, 0, 10, 0)

CreateTorus(0,2,1)

; material standard (left)
CreateMaterial(0, 0,$ff)
MaterialShininess(0,32,$ffffff)
CreateEntity(0, MeshID(0), MaterialID(0),3,0,0)

; material shader (right)
CreateShaderMaterial(1, #PB_Material_ColorShader)
SetMaterialColor(1, #PB_Material_DiffuseColor | #PB_Material_AmbientColor, $ff)
MaterialShininess(1,32,$ffffff)
CreateEntity(1, MeshID(0), MaterialID(1),-3,0,0)

Repeat
  While WindowEvent() : Wend
  ExamineKeyboard()
  ExamineMouse()
  
  RotateEntity(0, 0.2, 0.2, 0.2, #PB_Relative)
  RotateEntity(1, 0.2, 0.2, 0.2, #PB_Relative)
  
  RenderWorld()
  FlipBuffers()    
Until KeyboardReleased(#PB_Key_Escape) Or MouseButton(#PB_MouseButton_Middle)
si le résultat à l'air correcte sur votre machine, signalez le !
Avatar de l’utilisateur
Ar-S
Messages : 9476
Inscription : dim. 09/oct./2005 16:51
Contact :

Re: PB 6.00 - Shader : Afficher une couleur

Message par Ar-S »

L'ombre du Donut droit est noir de chez noir :?
~~~~Règles du forum ~~~~
⋅.˳˳.⋅ॱ˙˙ॱ⋅.˳Ar-S ˳.⋅ॱ˙˙ॱ⋅.˳˳.⋅
W11x64 PB 6.x
Section HORS SUJET : ICI
LDV MULTIMEDIA : Dépannage informatique & mes Logiciels PB
UPLOAD D'IMAGES : Uploader des images de vos logiciels
Avatar de l’utilisateur
falsam
Messages : 7244
Inscription : dim. 22/août/2010 15:24
Localisation : IDF (Yvelines)
Contact :

Re: PB 6.00 - Shader : Afficher une couleur

Message par falsam »

Le résultat en image (Configuration en signature)

Image

et le log
15:24:18: Creating resource group General
15:24:18: Creating resource group Internal
15:24:18: Creating resource group Autodetect
15:24:18: SceneManagerFactory for type 'DefaultSceneManager' registered.
15:24:18: Registering ResourceManager for type Material
15:24:18: Registering ResourceManager for type Mesh
15:24:18: Registering ResourceManager for type Skeleton
15:24:18: MovableObjectFactory for type 'ParticleSystem' registered.
15:24:18: OverlayElementFactory for type Panel registered.
15:24:18: OverlayElementFactory for type BorderPanel registered.
15:24:18: OverlayElementFactory for type TextArea registered.
15:24:18: Registering ResourceManager for type Font
15:24:18: ArchiveFactory for archive type FileSystem registered.
15:24:18: ArchiveFactory for archive type Zip registered.
15:24:18: ArchiveFactory for archive type EmbeddedZip registered.
15:24:18: DDS codec registering
15:24:18: FreeImage version: 3.10.0
15:24:18: This program uses FreeImage, a free, open source image library supporting all common bitmap formats. See http://freeimage.sourceforge.net for details
15:24:18: 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
15:24:18: PVRTC codec registering
15:24:18: Registering ResourceManager for type HighLevelGpuProgram
15:24:18: Registering ResourceManager for type Compositor
15:24:18: MovableObjectFactory for type 'Entity' registered.
15:24:18: MovableObjectFactory for type 'Light' registered.
15:24:18: MovableObjectFactory for type 'BillboardSet' registered.
15:24:18: MovableObjectFactory for type 'ManualObject' registered.
15:24:18: MovableObjectFactory for type 'BillboardChain' registered.
15:24:18: MovableObjectFactory for type 'RibbonTrail' registered.
15:24:18: *-*-* OGRE Initialising
15:24:18: *-*-* Version 1.8.2 (Byatis)
15:24:18: OpenGL Rendering Subsystem created.
15:24:18: Particle Emitter Type 'Point' registered
15:24:18: Particle Emitter Type 'Box' registered
15:24:18: Particle Emitter Type 'Ellipsoid' registered
15:24:18: Particle Emitter Type 'Cylinder' registered
15:24:18: Particle Emitter Type 'Ring' registered
15:24:18: Particle Emitter Type 'HollowEllipsoid' registered
15:24:18: Particle Affector Type 'LinearForce' registered
15:24:18: Particle Affector Type 'ColourFader' registered
15:24:18: Particle Affector Type 'ColourFader2' registered
15:24:18: Particle Affector Type 'ColourImage' registered
15:24:18: Particle Affector Type 'ColourInterpolator' registered
15:24:18: Particle Affector Type 'Scaler' registered
15:24:18: Particle Affector Type 'Rotator' registered
15:24:18: Particle Affector Type 'DirectionRandomiser' registered
15:24:18: Particle Affector Type 'DeflectorPlane' registered
15:24:18: PCZone Factory Type 'ZoneType_Default' registered
15:24:18: CPU Identifier & Features
15:24:18: -------------------------
15:24:18: * CPU ID: AuthenticAMD: AMD Ryzen 7 4800H with Radeon Graphics
15:24:18: * SSE: yes
15:24:18: * SSE2: yes
15:24:18: * SSE3: yes
15:24:18: * MMX: yes
15:24:18: * MMXEXT: yes
15:24:18: * 3DNOW: no
15:24:18: * 3DNOWEXT: no
15:24:18: * CMOV: yes
15:24:18: * TSC: yes
15:24:18: * FPU: yes
15:24:18: * PRO: yes
15:24:18: * HT: no
15:24:18: -------------------------
15:24:18: *** Starting Win32GL Subsystem ***
15:24:18: Registering ResourceManager for type Texture
15:24:18: SceneManagerFactory for type 'OctreeSceneManager' registered.
15:24:18: SceneManagerFactory for type 'BspSceneManager' registered.
15:24:18: Registering ResourceManager for type BspLevel
15:24:18: GLRenderSystem::_createRenderWindow "PureBasic Ogre", 768x855 windowed miscParams: FSAA=0 displayFrequency=0 externalWindowHandle=1771500 vsync=true
15:24:18: GL_VERSION = 4.6.0 NVIDIA 451.67
15:24:18: GL_VENDOR = NVIDIA Corporation
15:24:18: GL_RENDERER = GeForce GTX 1650 Ti/PCIe/SSE2
15:24:18: GL_EXTENSIONS = GL_AMD_multi_draw_indirect GL_AMD_seamless_cubemap_per_texture GL_AMD_vertex_shader_viewport_index GL_AMD_vertex_shader_layer GL_ARB_arrays_of_arrays GL_ARB_base_instance GL_ARB_bindless_texture GL_ARB_blend_func_extended GL_ARB_buffer_storage GL_ARB_clear_buffer_object GL_ARB_clear_texture GL_ARB_clip_control GL_ARB_color_buffer_float GL_ARB_compatibility GL_ARB_compressed_texture_pixel_storage GL_ARB_conservative_depth GL_ARB_compute_shader GL_ARB_compute_variable_group_size GL_ARB_conditional_render_inverted GL_ARB_copy_buffer GL_ARB_copy_image GL_ARB_cull_distance GL_ARB_debug_output GL_ARB_depth_buffer_float GL_ARB_depth_clamp GL_ARB_depth_texture GL_ARB_derivative_control GL_ARB_direct_state_access GL_ARB_draw_buffers GL_ARB_draw_buffers_blend GL_ARB_draw_indirect GL_ARB_draw_elements_base_vertex GL_ARB_draw_instanced GL_ARB_enhanced_layouts GL_ARB_ES2_compatibility GL_ARB_ES3_compatibility GL_ARB_ES3_1_compatibility GL_ARB_ES3_2_compatibility GL_ARB_explicit_attrib_location GL_ARB_explicit_uniform_location GL_ARB_fragment_coord_conventions GL_ARB_fragment_layer_viewport GL_ARB_fragment_program GL_ARB_fragment_program_shadow GL_ARB_fragment_shader GL_ARB_fragment_shader_interlock GL_ARB_framebuffer_no_attachments GL_ARB_framebuffer_object GL_ARB_framebuffer_sRGB GL_ARB_geometry_shader4 GL_ARB_get_program_binary GL_ARB_get_texture_sub_image GL_ARB_gl_spirv GL_ARB_gpu_shader5 GL_ARB_gpu_shader_fp64 GL_ARB_gpu_shader_int64 GL_ARB_half_float_pixel GL_ARB_half_float_vertex GL_ARB_imaging GL_ARB_indirect_parameters GL_ARB_instanced_arrays GL_ARB_internalformat_query GL_ARB_internalformat_query2 GL_ARB_invalidate_subdata GL_ARB_map_buffer_alignment GL_ARB_map_buffer_range GL_ARB_multi_bind GL_ARB_multi_draw_indirect GL_ARB_multisample GL_ARB_multitexture GL_ARB_occlusion_query GL_ARB_occlusion_query2 GL_ARB_parallel_shader_compile GL_ARB_pipeline_statistics_query GL_ARB_pixel_buffer_object GL_ARB_point_parameters GL_ARB_point_sprite GL_ARB_polygon_offset_clamp GL_ARB_post_depth_coverage GL_ARB_program_interface_query GL_ARB_provoking_vertex GL_ARB_query_buffer_object GL_ARB_robust_buffer_access_behavior GL_ARB_robustness GL_ARB_sample_locations GL_ARB_sample_shading GL_ARB_sampler_objects GL_ARB_seamless_cube_map GL_ARB_seamless_cubemap_per_texture GL_ARB_separate_shader_objects GL_ARB_shader_atomic_counter_ops GL_ARB_shader_atomic_counters GL_ARB_shader_ballot GL_ARB_shader_bit_encoding GL_ARB_shader_clock GL_ARB_shader_draw_parameters GL_ARB_shader_group_vote GL_ARB_shader_image_load_store GL_ARB_shader_image_size GL_ARB_shader_objects GL_ARB_shader_precision GL_ARB_shader_storage_buffer_object GL_ARB_shader_subroutine GL_ARB_shader_texture_image_samples GL_ARB_shader_texture_lod GL_ARB_shading_language_100 GL_ARB_shader_viewport_layer_array GL_ARB_shading_language_420pack GL_ARB_shading_language_include GL_ARB_shading_language_packing GL_ARB_shadow GL_ARB_sparse_buffer GL_ARB_sparse_texture GL_ARB_sparse_texture2 GL_ARB_sparse_texture_clamp GL_ARB_spirv_extensions GL_ARB_stencil_texturing GL_ARB_sync GL_ARB_tessellation_shader GL_ARB_texture_barrier GL_ARB_texture_border_clamp GL_ARB_texture_buffer_object GL_ARB_texture_buffer_object_rgb32 GL_ARB_texture_buffer_range 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_filter_anisotropic GL_ARB_texture_filter_minmax GL_ARB_texture_float GL_ARB_texture_gather GL_ARB_texture_mirror_clamp_to_edge GL_ARB_texture_mirrored_repeat GL_ARB_texture_multisample GL_ARB_texture_non_power_of_two GL_ARB_texture_query_levels GL_ARB_texture_query_lod GL_ARB_texture_rectangle GL_ARB_texture_rg GL_ARB_texture_rgb10_a2ui GL_ARB_texture_stencil8 GL_ARB_texture_storage GL_ARB_texture_storage_multisample GL_ARB_texture_swizzle GL_ARB_texture_view GL_ARB_timer_query GL_ARB_transform_feedback2 GL_ARB_transform_feedback3 GL_ARB_transform_feedback_instanced GL_ARB_transform_feedback_overflow_query 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_attrib_binding GL_ARB_vertex_buffer_object GL_ARB_vertex_program GL_ARB_vertex_shader GL_ARB_vertex_type_10f_11f_11f_rev GL_ARB_vertex_type_2_10_10_10_rev GL_ARB_viewport_array GL_ARB_window_pos GL_ATI_draw_buffers GL_ATI_texture_float GL_ATI_texture_mirror_once GL_S3_s3tc GL_EXT_texture_env_add 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_Cg_shader GL_EXT_depth_bounds_test 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_EXTX_framebuffer_mixed_formats GL_EXT_framebuffer_multisample_blit_scaled GL_EXT_framebuffer_object GL_EXT_framebuffer_sRGB GL_EXT_geometry_shader4 GL_EXT_gpu_program_parameters GL_EXT_gpu_shader4 GL_EXT_multi_draw_arrays GL_EXT_multiview_texture_multisample GL_EXT_multiview_timer_query GL_EXT_packed_depth_stencil GL_EXT_packed_float GL_EXT_packed_pixels GL_EXT_pixel_buffer_object GL_EXT_point_parameters GL_EXT_polygon_offset_clamp GL_EXT_post_depth_coverage GL_EXT_provoking_vertex GL_EXT_raster_multisample GL_EXT_rescale_normal GL_EXT_secondary_color GL_EXT_separate_shader_objects GL_EXT_separate_specular_color GL_EXT_shader_image_load_formatted GL_EXT_shader_image_load_store GL_EXT_shader_integer_mix GL_EXT_shadow_funcs GL_EXT_sparse_texture2 GL_EXT_stencil_two_side GL_EXT_stencil_wrap GL_EXT_texture3D GL_EXT_texture_array GL_EXT_texture_buffer_object GL_EXT_texture_compression_dxt1 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_combine GL_EXT_texture_env_dot3 GL_EXT_texture_filter_anisotropic GL_EXT_texture_filter_minmax 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_shadow_lod GL_EXT_texture_shared_exponent GL_EXT_texture_sRGB GL_EXT_texture_sRGB_R8 GL_EXT_texture_sRGB_decode GL_EXT_texture_storage GL_EXT_texture_swizzle GL_EXT_timer_query GL_EXT_transform_feedback2 GL_EXT_vertex_array GL_EXT_vertex_array_bgra GL_EXT_vertex_attrib_64bit GL_EXT_window_rectangles GL_EXT_import_sync_object GL_IBM_rasterpos_clip GL_IBM_texture_mirrored_repeat GL_KHR_context_flush_control GL_KHR_debug GL_EXT_memory_object GL_EXT_memory_object_win32 GL_EXT_win32_keyed_mutex GL_KHR_parallel_shader_compile GL_KHR_no_error GL_KHR_robust_buffer_access_behavior GL_KHR_robustness GL_EXT_semaphore GL_EXT_semaphore_win32 GL_KHR_shader_subgroup GL_KTX_buffer_region GL_NV_alpha_to_coverage_dither_control GL_NV_bindless_multi_draw_indirect GL_NV_bindless_multi_draw_indirect_count GL_NV_bindless_texture GL_NV_blend_equation_advanced GL_NV_blend_equation_advanced_coherent GL_NVX_blend_equation_advanced_multi_draw_buffers GL_NV_blend_minmax_factor GL_NV_blend_square GL_NV_clip_space_w_scaling GL_NV_command_list GL_NV_compute_program5 GL_NV_compute_shader_derivatives GL_NV_conditional_render GL_NV_conservative_raster GL_NV_conservative_raster_dilate GL_NV_conservative_raster_pre_snap GL_NV_conservative_raster_pre_snap_triangles GL_NV_conservative_raster_underestimation GL_NV_copy_depth_to_color GL_NV_copy_image GL_NV_depth_buffer_float GL_NV_depth_clamp GL_NV_draw_texture GL_NV_draw_vulkan_image GL_NV_ES1_1_compatibility GL_NV_ES3_1_compatibility GL_NV_explicit_multisample GL_NV_feature_query GL_NV_fence GL_NV_fill_rectangle GL_NV_float_buffer GL_NV_fog_distance GL_NV_fragment_coverage_to_color GL_NV_fragment_program GL_NV_fragment_program_option GL_NV_fragment_program2 GL_NV_fragment_shader_barycentric GL_NV_fragment_shader_interlock GL_NV_framebuffer_mixed_samples GL_NV_framebuffer_multisample_coverage GL_NV_geometry_shader4 GL_NV_geometry_shader_passthrough GL_NV_gpu_program4 GL_NV_internalformat_sample_query GL_NV_gpu_program4_1 GL_NV_gpu_program5 GL_NV_gpu_program5_mem_extended GL_NV_gpu_program_fp64 GL_NV_gpu_shader5 GL_NV_half_float GL_NV_light_max_exponent GL_NV_memory_attachment GL_NV_mesh_shader GL_NV_multisample_coverage GL_NV_multisample_filter_hint GL_NV_occlusion_query GL_NV_packed_depth_stencil GL_NV_parameter_buffer_object GL_NV_parameter_buffer_object2 GL_NV_path_rendering GL_NV_path_rendering_shared_edge GL_NV_pixel_data_range GL_NV_point_sprite GL_NV_primitive_restart GL_NV_query_resource GL_NV_query_resource_tag GL_NV_register_combiners GL_NV_register_combiners2 GL_NV_representative_fragment_test GL_NV_sample_locations GL_NV_sample_mask_override_coverage GL_NV_scissor_exclusive GL_NV_shader_atomic_counters GL_NV_shader_atomic_float GL_NV_shader_atomic_float64 GL_NV_shader_atomic_fp16_vector GL_NV_shader_atomic_int64 GL_NV_shader_buffer_load GL_NV_shader_storage_buffer_object GL_NV_shader_subgroup_partitioned GL_NV_shader_texture_footprint GL_NV_shading_rate_image GL_NV_stereo_view_rendering GL_NV_texgen_reflection GL_NV_texture_barrier GL_NV_texture_compression_vtc GL_NV_texture_env_combine4 GL_NV_texture_multisample GL_NV_texture_rectangle GL_NV_texture_rectangle_compressed GL_NV_texture_shader GL_NV_texture_shader2 GL_NV_texture_shader3 GL_NV_transform_feedback GL_NV_transform_feedback2 GL_NV_uniform_buffer_unified_memory GL_NV_vertex_array_range GL_NV_vertex_array_range2 GL_NV_vertex_attrib_integer_64bit GL_NV_vertex_buffer_unified_memory GL_NV_vertex_program GL_NV_vertex_program1_1 GL_NV_vertex_program2 GL_NV_vertex_program2_option GL_NV_vertex_program3 GL_NV_viewport_array2 GL_NV_viewport_swizzle GL_NVX_conditional_render GL_NVX_linked_gpu_multicast GL_NV_gpu_multicast GL_NVX_gpu_multicast2 GL_NVX_progress_fence GL_NVX_gpu_memory_info GL_NVX_multigpu_info GL_NVX_nvenc_interop GL_NV_shader_thread_group GL_NV_shader_thread_shuffle GL_KHR_blend_equation_advanced GL_KHR_blend_equation_advanced_coherent GL_OVR_multiview GL_OVR_multiview2 GL_SGIS_generate_mipmap GL_SGIS_texture_lod GL_SGIX_depth_texture GL_SGIX_shadow GL_SUN_slice_accum GL_WIN_swap_hint WGL_EXT_swap_control
15:24:18: Supported WGL extensions: WGL_ARB_buffer_region WGL_ARB_create_context WGL_ARB_create_context_no_error WGL_ARB_create_context_profile WGL_ARB_create_context_robustness WGL_ARB_context_flush_control WGL_ARB_extensions_string WGL_ARB_make_current_read WGL_ARB_multisample WGL_ARB_pbuffer WGL_ARB_pixel_format WGL_ARB_pixel_format_float WGL_ARB_render_texture WGL_ATI_pixel_format_float WGL_EXT_colorspace WGL_EXT_create_context_es_profile WGL_EXT_create_context_es2_profile WGL_EXT_extensions_string WGL_EXT_framebuffer_sRGB WGL_EXT_pixel_format_packed_float WGL_EXT_swap_control WGL_EXT_swap_control_tear WGL_NVX_DX_interop WGL_NV_DX_interop WGL_NV_DX_interop2 WGL_NV_copy_image WGL_NV_delay_before_swap WGL_NV_float_buffer WGL_NV_multisample_coverage WGL_NV_multigpu_context WGL_NV_render_depth_texture WGL_NV_render_texture_rectangle
15:24:18: ***************************
15:24:18: *** GL Renderer Started ***
15:24:18: ***************************
15:24:18: Registering ResourceManager for type GpuProgram
15:24:18: GLSL support detected
15:24:18: GL: Using GL_EXT_framebuffer_object for rendering to textures (best)
15:24:18: FBO PF_UNKNOWN depth/stencil support: D0S8 D16S0 D24S0 D32S0 Packed-D24S8
15:24:18: FBO PF_L8 depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8
15:24:18: FBO PF_A8 depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8
15:24:18: FBO PF_A4L4 depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8
15:24:18: FBO PF_BYTE_LA depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8
15:24:18: FBO PF_R5G6B5 depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8
15:24:18: FBO PF_B5G6R5 depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8
15:24:18: FBO PF_A4R4G4B4 depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8
15:24:18: FBO PF_A1R5G5B5 depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8
15:24:18: FBO PF_R8G8B8 depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8
15:24:18: FBO PF_B8G8R8 depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8
15:24:18: FBO PF_A8R8G8B8 depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8
15:24:18: FBO PF_B8G8R8A8 depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8
15:24:18: FBO PF_A2R10G10B10 depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8
15:24:18: FBO PF_A2B10G10R10 depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8
15:24:18: FBO PF_FLOAT16_RGB depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8
15:24:18: FBO PF_FLOAT16_RGBA depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8
15:24:18: FBO PF_FLOAT32_RGB depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8
15:24:18: FBO PF_FLOAT32_RGBA depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8
15:24:18: FBO PF_X8R8G8B8 depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8
15:24:18: FBO PF_X8B8G8R8 depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8
15:24:18: FBO PF_SHORT_RGBA depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8
15:24:18: FBO PF_R3G3B2 depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8
15:24:18: FBO PF_FLOAT16_R depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8
15:24:18: FBO PF_FLOAT32_R depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8
15:24:18: FBO PF_FLOAT16_GR depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8
15:24:18: FBO PF_FLOAT32_GR depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8
15:24:18: FBO PF_SHORT_RGB depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8
15:24:18: [GL] : Valid FBO targets PF_UNKNOWN PF_L8 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_FLOAT16_GR PF_FLOAT32_GR PF_SHORT_RGB
15:24:18: RenderSystem capabilities
15:24:18: -------------------------
15:24:18: RenderSystem Name: OpenGL Rendering Subsystem
15:24:18: GPU Vendor: nvidia
15:24:18: Device Name: GeForce GTX 1650 Ti/PCIe/SSE2
15:24:18: Driver Version: 4.6.0.0
15:24:18: * Fixed function pipeline: yes
15:24:18: * Hardware generation of mipmaps: yes
15:24:18: * Texture blending: yes
15:24:18: * Anisotropic texture filtering: yes
15:24:18: * Dot product texture operation: yes
15:24:18: * Cube mapping: yes
15:24:18: * Hardware stencil buffer: yes
15:24:18: - Stencil depth: 8
15:24:18: - Two sided stencil support: yes
15:24:18: - Wrap stencil values: yes
15:24:18: * Hardware vertex / index buffers: yes
15:24:18: * Vertex programs: yes
15:24:18: * Number of floating-point constants for vertex programs: 1024
15:24:18: * Number of integer constants for vertex programs: 0
15:24:18: * Number of boolean constants for vertex programs: 0
15:24:18: * Fragment programs: yes
15:24:18: * Number of floating-point constants for fragment programs: 1024
15:24:18: * Number of integer constants for fragment programs: 0
15:24:18: * Number of boolean constants for fragment programs: 0
15:24:18: * Geometry programs: yes
15:24:18: * Number of floating-point constants for geometry programs: 2048
15:24:18: * Number of integer constants for geometry programs: 0
15:24:18: * Number of boolean constants for geometry programs: 0
15:24:18: * Supported Shader Profiles: arbfp1 arbvp1 fp20 fp30 fp40 glsl gp4fp gp4gp gp4vp gpu_fp gpu_gp gpu_vp nvgp4 vp30 vp40
15:24:18: * Texture Compression: yes
15:24:18: - DXT: yes
15:24:18: - VTC: yes
15:24:18: - PVRTC: no
15:24:18: * Scissor Rectangle: yes
15:24:18: * Hardware Occlusion Query: yes
15:24:18: * User clip planes: yes
15:24:18: * VET_UBYTE4 vertex element type: yes
15:24:18: * Infinite far plane projection: yes
15:24:18: * Hardware render-to-texture: yes
15:24:18: * Floating point textures: yes
15:24:18: * Non-power-of-two textures: yes
15:24:18: * Volume textures: yes
15:24:18: * Multiple Render Targets: 8
15:24:18: - With different bit depths: yes
15:24:18: * Point Sprites: yes
15:24:18: * Extended point parameters: yes
15:24:18: * Max Point Size: 2047
15:24:18: * Vertex texture fetch: yes
15:24:18: * Number of world matrices: 0
15:24:18: * Number of texture units: 32
15:24:18: * Stencil buffer depth: 8
15:24:18: * Number of vertex blend matrices: 0
15:24:18: - Max vertex textures: 32
15:24:18: - Vertex textures shared: yes
15:24:18: * Render to Vertex Buffer : yes
15:24:18: * GL 1.5 without VBO workaround: no
15:24:18: * Frame Buffer objects: yes
15:24:18: * Frame Buffer objects (ARB extension): no
15:24:18: * Frame Buffer objects (ATI extension): no
15:24:18: * PBuffer support: yes
15:24:18: * GL 1.5 without HW-occlusion workaround: no
15:24:18: * Separate shader objects: no
15:24:18: DefaultWorkQueue('Root') initialising on thread main.
15:24:18: Particle Renderer Type 'billboard' registered
15:24:18: Added resource location 'C:\Program Files\PureBasic600\examples\3D\Data\Textures' of type 'FileSystem' to resource group 'General'
15:24:18: Added resource location 'C:\Purebasic Project\3D\' of type 'FileSystem' to resource group 'General'
15:24:18: Parsing scripts for resource group Autodetect
15:24:18: Finished parsing scripts for resource group Autodetect
15:24:18: Creating resources for group Autodetect
15:24:18: All done
15:24:18: Parsing scripts for resource group General
15:24:18: Finished parsing scripts for resource group General
15:24:18: Creating resources for group General
15:24:18: All done
15:24:18: Parsing scripts for resource group Internal
15:24:18: Finished parsing scripts for resource group Internal
15:24:18: Creating resources for group Internal
15:24:18: All done
15:24:18: Texture: Dirt.jpg: Loading 1 faces(PF_R8G8B8,256x256x1) with 8 hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,256x256x1.
15:24:18: Texture: grass.jpg: Loading 1 faces(PF_R8G8B8,512x512x1) with 9 hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
15:24:18: Texture: RustySteel.jpg: Loading 1 faces(PF_R8G8B8,256x256x1) with 8 hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,256x256x1.
15:24:18: Can't assign material Torus to SubEntity of E0 because this Material does not exist. Have you forgotten to define it in a .material script?
Configuration : Windows 11 Famille 64-bit - PB 6.03 x64 - AMD Ryzen 7 - 16 GO RAM
Vidéo NVIDIA GeForce GTX 1650 Ti - Résolution 1920x1080 - Mise à l'échelle 125%
Avatar de l’utilisateur
falsam
Messages : 7244
Inscription : dim. 22/août/2010 15:24
Localisation : IDF (Yvelines)
Contact :

Re: PB 6.00 - Shader : Afficher une couleur

Message par falsam »

J'ai finit par avoir des doutes sur ma carte graphique.

J'ai donc lancé un benchmark OpenGl avec l'application BaseMarkGPU et je suis rassuré.

Image
Configuration : Windows 11 Famille 64-bit - PB 6.03 x64 - AMD Ryzen 7 - 16 GO RAM
Vidéo NVIDIA GeForce GTX 1650 Ti - Résolution 1920x1080 - Mise à l'échelle 125%
Avatar de l’utilisateur
Guillot
Messages : 527
Inscription : jeu. 25/juin/2015 16:18

Re: PB 6.00 - Shader : Afficher une couleur

Message par Guillot »

merci falsam

aucune info relative à la compilation du shader
(peut etre un plantage lors de sa compilation)

je vais ouvrir un fil "bug shader" avec une version minimalliste
Avatar de l’utilisateur
Guillot
Messages : 527
Inscription : jeu. 25/juin/2015 16:18

Re: PB 6.00 - Shader : Afficher une couleur

Message par Guillot »

salut l'équipe

j'ai fais une petite modif sur mon exemple pour comparer l'ombrage standard avec l'ombrage perpixel
pouvez vous tester et me dire si ça change quelque chose

Code : Tout sélectionner

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

ExamineDesktops()
OpenWindow(0, 0,0, DesktopWidth(0)*0.8,DesktopHeight(0)*0.8, "Shader - [Esc] quit",#PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0), 0, 0, WindowWidth(0), WindowHeight(0), 0, 0, 0)

CreateCamera(0, 0, 0, 100, 100) : MoveCamera(0,0,3,-8) : CameraLookAt(0,0,0,0)
CameraBackColor(0,$444488)
AmbientColor($444444)

CreateLight(0, $ffffff, 0, 10, 0)

CreateTorus(0,2,1)

; material standard (left)
CreateMaterial(0, 0,$ff)
MaterialShininess(0,32,$ffffff)
CreateEntity(0, MeshID(0), MaterialID(0),3,0,0)

; material shader (right)
vert_pg.s="%%%#version 130%%uniform mat4 worldviewproj_matrix;//+24%uniform vec4 camera_pos_os;//+77%uniform vec4 light_pos_os;//+44 0%uniform vec4 light_att;//+41 0%uniform vec4 fog_params;//+31%%out vec3 oviewdir;%out vec3 olightdir;%out vec3 onormal;%out vec4 ovcolor;%out float olightatt;%out float ofogf;%%void main()%{%oviewdir = normalize(camera_pos_os.xyz - gl_Vertex.xyz);%olightdir = normalize(light_pos_os.xyz - gl_Vertex.xyz);%gl_Position = worldviewproj_matrix * gl_Vertex;%onormal = gl_Normal;%float Dist = distance(light_pos_os,gl_Vertex);%olightatt = 1/(light_att.y + light_att.z * Dist + light_att.w * Dist * Dist);%ovcolor = gl_Color;%if (fog_params.z > 0) ofogf = min(gl_Position.z * fog_params.w,1);%}%%%%"
frag_pg.s="%%%#version 130%%uniform vec4 diffuse_ml;//+69 0%uniform vec4 specular_ml;//+70 0%uniform vec4 ambient_ml;//+67 0%uniform float shininess;//+36%uniform vec4 fog_colour;//+30%%in vec3 oviewdir;%in vec3 olightdir;%in vec3 onormal;%in vec4 ovcolor;%in float olightatt;%in float ofogf;%%out vec4 gl_FragColor;%void main()%{%vec3 normal=normalize(onormal);%vec3 viewdir=normalize(oviewdir);%vec3 lightdir=normalize(olightdir);%float dif=max(dot(lightdir, normal), 0)*olightatt;%float spe=pow(dot(normalize(lightdir + viewdir), normal),shininess);%vec4 color=(ambient_ml + diffuse_ml * dif) + specular_ml* spe;%gl_FragColor=mix(color ,fog_colour, ofogf);%}%%%%"
CreateShader(0,vert_pg,frag_pg)
CreateShaderMaterial(1, 0)
SetMaterialColor(1, #PB_Material_DiffuseColor | #PB_Material_AmbientColor, $ff)
MaterialShininess(1,32,$ffffff)
CreateEntity(1, MeshID(0), MaterialID(1),-3,0,0)

Repeat
  While WindowEvent() : Wend
  ExamineKeyboard()
  ExamineMouse()
  
  RotateEntity(0, 0.2, 0.2, 0.2, #PB_Relative)
  RotateEntity(1, 0.2, 0.2, 0.2, #PB_Relative)
  
  RenderWorld()
  FlipBuffers()    
Until KeyboardReleased(#PB_Key_Escape) Or MouseButton(#PB_MouseButton_Middle)
Mesa
Messages : 1097
Inscription : mer. 14/sept./2011 16:59

Re: PB 6.00 - Shader : Afficher une couleur

Message par Mesa »

Pas de changement ici, même problème.

M.
Répondre