leanderr Posted May 23, 2018 Share Posted May 23, 2018 Hey guys, as optimizing a project for performance I'm wondering for a low hardware fallback option that ensures the highest fps. Since I was using shaders and grid material before I fell back on the standard material and used point lights instead of spot lights. I could barely see any frame advances on this approach. Is there any knowledge which texture/material/rendering style and which light source stresses the gpu the least and which eventually stresses it the most? I also wonder if there is any option as resolution scaling or disabling every kind of shading globally or locally. Quote Link to comment Share on other sites More sharing options...
Amarth2Estel Posted May 23, 2018 Share Posted May 23, 2018 Hi Leanderr ! Optimization is the key ! To say it fast, to improve performances, you should reduce the draw calls. You can use instances, merge meshes, using light (not heavy) texture files etc.. You should freeze matrices and materials, when it is possible to avoid useless computation. Especially in static scene, there is a lot of "manual" optimization you can do to improve the performance. Of course, having as less lights as possible in your scene. 1 can be enough in a lot of scenario if you use tricks like ambient lighting or illumination maps. From the screenshot of the debug layer, I can see that there is 6 materials for 16 active meshes. You should try to merge meshes sharing the same material. ------- Once every little optimization done in your scene, if the hardware is still not powerful enough to render the scene smoothy, you may disable rendering features. BabylonJS has its own Scene Optimizer to do it. You should have a look there : https://doc.babylonjs.com/how_to/optimizing_your_scene and here : https://doc.babylonjs.com/how_to/how_to_use_sceneoptimizer To conclude, you can render your scene in a tiniyer resolution than your canvas, but the result will be streched to the canvas resolution so it will of course be blurry. In my opinion, this is something you should do only if you know you have already done every other optimization. To do so, just use engine.setHardwareScalingLevel = n (with n < 1); See http://doc.babylonjs.com/api/classes/babylon.engine Hope it helps! leanderr 1 Quote Link to comment Share on other sites More sharing options...
leanderr Posted May 23, 2018 Author Share Posted May 23, 2018 I believe the first link you sent absolutely does it for me. I've been looking through optimization stuff for half an hour without finding this article. Must have been blind. Thanks so much. SOLVED: https://doc.babylonjs.com/how_to/optimizing_your_scene I still feel a bit puzzled what "frame, inter frame, meshes selection, render targets" and stuff on the stats page mean. The Debug Layer Documentation does not really provide these answers. https://doc.babylonjs.com/features/playground_debuglayer#tool-bar Mayb we can crowdsource a little guide like "if you stat X exploding in your debug layer try solution Y because Z"? Quote Link to comment Share on other sites More sharing options...
Guest Posted May 23, 2018 Share Posted May 23, 2018 Crowdsourcing doc: Would love to get some help in this front - Frame is the time spent by the CPU to prepare a frame. You can optimize here definitely - Inter frame is the time spend inside the driver. You must optimize draw calls or shader to optimize here - meshes selection: Time spent to go through the scene to detect visible meshes - render targets: time spent rendering render targets (like shadow maps) leanderr 1 Quote Link to comment Share on other sites More sharing options...
leanderr Posted May 24, 2018 Author Share Posted May 24, 2018 I managed to merge every mesh together, I froze everything materials, meshes, worldCoordinates, removed indexing. I'm now down from 14 to 2 drawcalls. I've got a very simple scene: 6 planes and 2 lights, only standard material. Still the inter-frame is sometimes spiking at 30+... Pretty good Laptop with dedicated GPU. So the main question I asked stays very relevant? Is it the material's or shaders fault? (marked as unsolved again) Quote Link to comment Share on other sites More sharing options...
Guest Posted May 24, 2018 Share Posted May 24, 2018 You have either a driver problem. 88 potential fps is pretty low. The interframe is really big so this could be: - Driver issue - Battery conservation - Problem within the browser - discrete GPU not being selected by the browser Quote Link to comment Share on other sites More sharing options...
leanderr Posted May 24, 2018 Author Share Posted May 24, 2018 Its a Browser Issue... In chrome the potential FPS averages out at 600. In edge and firefox the performance is going through the roof with potential FPS mostly at infinity or a few thousands... That's weird af since crome is running at the newest Build 66+... I'll try to figure out and report more... Marked as solved again, trying to fix my driver situations, darn you lenovo driver center... Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted May 25, 2018 Share Posted May 25, 2018 Do you have your hardware acceleration enabled in the browser options? If I were a betting man I wager its turned off.. Quote Link to comment Share on other sites More sharing options...
leanderr Posted May 25, 2018 Author Share Posted May 25, 2018 Yes, it is enabled. I tried other lower spec PCs all with similar issues. You can check out my project at http://h2783557.stratoserver.net/ You can try different amount of Details and shader settings with. localstorage.setItem('effects', 'high'); localstorage.setItem('effects', 'mid'); localstorage.setItem('effects', 'low'); Is it possible at all to 10 simple meshes with a standard material and a simple GUI at full FPS on a simple laptop? Or did I cap out the engine here? Inter Frame and Frame are going all over the place everywhere ? Graphics Feature Status Canvas: Hardware accelerated CheckerImaging: Disabled Flash: Hardware accelerated Flash Stage3D: Hardware accelerated Flash Stage3D Baseline profile: Hardware accelerated Compositing: Hardware accelerated Multiple Raster Threads: Enabled Native GpuMemoryBuffers: Software only. Hardware acceleration disabled Rasterization: Hardware accelerated Surface Synchronization: Enabled Video Decode: Hardware accelerated WebGL: Hardware accelerated WebGL2: Hardware accelerated Driver Bug Workarounds clear_uniforms_before_first_program_use decode_encode_srgb_for_generatemipmap disable_accelerated_vpx_decode disable_discard_framebuffer disable_framebuffer_cmaa disable_larger_than_screen_overlays exit_on_context_lost force_cube_complete msaa_is_slow scalarize_vec_and_mat_constructor_args texsubimage_faster_than_teximage Problems Detected Some drivers are unable to reset the D3D device in the GPU process sandbox Applied Workarounds: exit_on_context_lost TexSubImage is faster for full uploads on ANGLE Applied Workarounds: texsubimage_faster_than_teximage Clear uniforms before first program use on all platforms: 124764, 349137 Applied Workarounds: clear_uniforms_before_first_program_use Always rewrite vec/mat constructors to be consistent: 398694 Applied Workarounds: scalarize_vec_and_mat_constructor_args ANGLE crash on glReadPixels from incomplete cube map texture: 518889 Applied Workarounds: force_cube_complete On Intel GPUs MSAA performance is not acceptable for GPU rasterization: 527565 Applied Workarounds: msaa_is_slow Framebuffer discarding can hurt performance on non-tilers: 570897 Applied Workarounds: disable_discard_framebuffer Use GL_INTEL_framebuffer_CMAA on ChromeOS: 535198 Applied Workarounds: disable_framebuffer_cmaa Disable KHR_blend_equation_advanced until cc shaders are updated: 661715 Applied Workarounds: disable(GL_KHR_blend_equation_advanced), disable(GL_KHR_blend_equation_advanced_coherent) Decode and Encode before generateMipmap for srgb format textures on Windows: 634519 Applied Workarounds: decode_encode_srgb_for_generatemipmap VPx decoding is too slow on Intel Broadwell, Skylake, and CherryView: 616318 Applied Workarounds: disable_accelerated_vpx_decode Accelerated VPx decoding is hanging on some videos.: 654111 Applied Workarounds: disable_accelerated_vpx_decode Overlay sizes bigger than screen aren't accelerated on some Intel drivers: 720059 Applied Workarounds: disable_larger_than_screen_overlays Don't expose disjoint_timer_query extensions to WebGL: 808744 Native GpuMemoryBuffers have been disabled, either via about:flags or command line. Disabled Features: native_gpu_memory_buffers Checker-imaging has been disabled via finch trial or the command line. Disabled Features: checker_imaging Version Information Data exported 2018-05-25T09:06:56.917Z Chrome version Chrome/66.0.3359.181 Operating system Windows NT 10.0.16299 Software rendering list URL https://chromium.googlesource.com/chromium/src/+/a10b9cedb40738cb152f8148ddab4891df876959/gpu/config/software_rendering_list.json Driver bug list URL https://chromium.googlesource.com/chromium/src/+/a10b9cedb40738cb152f8148ddab4891df876959/gpu/config/gpu_driver_bug_list.json ANGLE commit id 22c768fbda54 2D graphics backend Skia/66 773868fdade5f9f0e7697e6d09c9bd80aaa9b402- Command Line "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --flag-switches-begin --flag-switches-end Driver Information Initialization time 225 In-process GPU false Passthrough Command Decoder false Direct Composition true Supports overlays true Sandboxed true GPU0 VENDOR = 0x8086, DEVICE= 0x191b *ACTIVE* GPU1 VENDOR = 0x10de, DEVICE= 0x134d Optimus false Optimus false AMD switchable false Desktop compositing Aero Glass Diagonal Monitor Size of \\.\DISPLAY1 13.9" Driver vendor Intel Corporation Driver version 21.20.16.4534 Driver date 10-7-2016 Pixel shader version 5.0 Vertex shader version 5.0 Max. MSAA samples 16 Machine model name Machine model version GL_VENDOR Google Inc. GL_RENDERER ANGLE (Intel(R) HD Graphics 530 Direct3D11 vs_5_0 ps_5_0) GL_VERSION OpenGL ES 2.0 (ANGLE 2.1.0.22c768fbda54) GL_EXTENSIONS GL_ANGLE_client_arrays GL_ANGLE_depth_texture GL_ANGLE_framebuffer_blit GL_ANGLE_framebuffer_multisample GL_ANGLE_instanced_arrays GL_ANGLE_lossy_etc_decode GL_ANGLE_pack_reverse_row_order GL_ANGLE_program_cache_control GL_ANGLE_request_extension GL_ANGLE_robust_client_memory GL_ANGLE_texture_compression_dxt3 GL_ANGLE_texture_compression_dxt5 GL_ANGLE_texture_usage GL_ANGLE_translated_shader_source GL_CHROMIUM_bind_generates_resource GL_CHROMIUM_bind_uniform_location GL_CHROMIUM_color_buffer_float_rgb GL_CHROMIUM_color_buffer_float_rgba GL_CHROMIUM_copy_compressed_texture GL_CHROMIUM_copy_texture GL_CHROMIUM_sync_query GL_EXT_blend_minmax GL_EXT_color_buffer_half_float GL_EXT_debug_marker GL_EXT_discard_framebuffer GL_EXT_disjoint_timer_query GL_EXT_draw_buffers GL_EXT_frag_depth GL_EXT_map_buffer_range GL_EXT_occlusion_query_boolean GL_EXT_read_format_bgra GL_EXT_robustness GL_EXT_sRGB GL_EXT_shader_texture_lod GL_EXT_texture_compression_dxt1 GL_EXT_texture_compression_s3tc_srgb GL_EXT_texture_filter_anisotropic GL_EXT_texture_format_BGRA8888 GL_EXT_texture_rg GL_EXT_texture_storage GL_EXT_unpack_subimage GL_KHR_debug GL_NV_EGL_stream_consumer_external GL_NV_fence GL_NV_pack_subimage GL_NV_pixel_buffer_object GL_OES_EGL_image GL_OES_EGL_image_external GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth32 GL_OES_element_index_uint GL_OES_get_program_binary GL_OES_mapbuffer GL_OES_packed_depth_stencil GL_OES_rgb8_rgba8 GL_OES_standard_derivatives GL_OES_surfaceless_context GL_OES_texture_float GL_OES_texture_float_linear GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_texture_npot GL_OES_vertex_array_object Disabled Extensions GL_KHR_blend_equation_advanced GL_KHR_blend_equation_advanced_coherent Disabled WebGL Extensions EXT_disjoint_timer_query EXT_disjoint_timer_query_webgl2 Window system binding vendor Google Inc. (adapter LUID: 000000000000da00) Window system binding version 1.4 (ANGLE 2.1.0.22c768fbda54) Window system binding extensions EGL_EXT_create_context_robustness EGL_ANGLE_d3d_share_handle_client_buffer EGL_ANGLE_d3d_texture_client_buffer EGL_ANGLE_surface_d3d_texture_2d_share_handle EGL_ANGLE_query_surface_pointer EGL_ANGLE_window_fixed_size EGL_ANGLE_keyed_mutex EGL_ANGLE_surface_orientation EGL_ANGLE_direct_composition EGL_NV_post_sub_buffer EGL_KHR_create_context EGL_EXT_device_query EGL_KHR_image EGL_KHR_image_base EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_gl_renderbuffer_image EGL_KHR_get_all_proc_addresses EGL_KHR_stream EGL_KHR_stream_consumer_gltexture EGL_NV_stream_consumer_gltexture_yuv EGL_ANGLE_flexible_surface_compatibility EGL_ANGLE_stream_producer_d3d_texture EGL_ANGLE_create_context_webgl_compatibility EGL_CHROMIUM_create_context_bind_generates_resource EGL_CHROMIUM_sync_control EGL_EXT_pixel_format_float EGL_KHR_surfaceless_context EGL_ANGLE_display_texture_share_group EGL_ANGLE_create_context_client_arrays EGL_ANGLE_program_cache_control EGL_ANGLE_robust_resource_initialization Direct rendering Yes Reset notification strategy 0x8252 GPU process crash count 0 Compositor Information Tile Update Mode One-copy Partial Raster Enabled GpuMemoryBuffers Status ATC Software only ATCIA Software only DXT1 Software only DXT5 Software only ETC1 Software only R_8 Software only R_16 Software only RG_88 Software only BGR_565 Software only RGBA_4444 Software only RGBX_8888 GPU_READ, SCANOUT RGBA_8888 GPU_READ, SCANOUT BGRX_8888 Software only BGRX_1010102 Software only RGBX_1010102 Software only BGRA_8888 Software only RGBA_F16 Software only YVU_420 Software only YUV_420_BIPLANAR Software only UYVY_422 Software only Display(s) Information Info Display[2528732444] bounds=0,0 1920x1080, workarea=0,0 1920x1050, scale=1, external Color space information {primaries:BT709, transfer:IEC61966_2_1, matrix:RGB, range:FULL} Bits per color component 8 Bits per pixel 24 Video Acceleration Information Decode h264 baseline up to 4096x2304 pixels Decode h264 baseline up to 2304x4096 pixels Decode h264 main up to 4096x2304 pixels Decode h264 main up to 2304x4096 pixels Decode h264 high up to 4096x2304 pixels Decode h264 high up to 2304x4096 pixels Encode h264 baseline up to 3840x2176 pixels and/or 30.000 fps Encode h264 main up to 3840x2176 pixels and/or 30.000 fps Encode h264 high up to 3840x2176 pixels and/or 30.000 fps Diagnostics 0 b3DAccelerationEnabled true b3DAccelerationExists true bAGPEnabled true bAGPExistenceValid true bAGPExists true bCanRenderWindow true bDDAccelerationEnabled true bDriverBeta false bDriverDebug false bDriverSigned false bDriverSignedValid false bNoHardware false dwBpp 32 dwDDIVersion 12 dwHeight 1080 dwRefreshRate 60 dwWHQLLevel 0 dwWidth 1920 iAdapter 0 lDriverSize 95023168 lMiniVddSize 0 szAGPStatusEnglish Enabled szAGPStatusLocalized Enabled szChipType Intel(R) HD Graphics Family szD3DStatusEnglish Enabled szD3DStatusLocalized Enabled szDACType Internal szDDIVersionEnglish 12 szDDIVersionLocalized 12 szDDStatusEnglish Enabled szDDStatusLocalized Enabled szDXVAHDEnglish Supported szDXVAModes ModeMPEG2_A ModeMPEG2_C ModeWMV9_C ModeVC1_C szDescription Intel(R) HD Graphics 530 szDeviceId 0x191B szDeviceIdentifier {D7B78E66-5A5B-11CF-AC65-4070BDC2D835} szDeviceName \\.\DISPLAY1 szDisplayMemoryEnglish 4156 MB szDisplayMemoryLocalized 4156 MB szDisplayModeEnglish 1920 x 1080 (32 bit) (60Hz) szDisplayModeLocalized 1920 x 1080 (32 bit) (60Hz) szDriverAssemblyVersion 21.20.16.4534 szDriverAttributes Final Retail szDriverDateEnglish 10/7/2016 2:00:00 AM szDriverDateLocalized 10/7/2016 02:00:00 szDriverLanguageEnglish English szDriverLanguageLocalized English szDriverModelEnglish WDDM 2.1 szDriverModelLocalized WDDM 2.1 szDriverName C:\WINDOWS\System32\DriverStore\FileRepository\igdlh64.inf_amd64_1ee0e91871b217e3\igdumdim64.dll,C:\WINDOWS\System32\DriverStore\FileRepository\igdlh64.inf_amd64_1ee0e91871b217e3\igd10iumd64.dll,C:\WINDOWS\System32\DriverStore\FileRepository\igdlh64.inf_amd64_1ee0e91871b217e3\igd10iumd64.dll,C:\WINDOWS\System32\DriverStore\FileRepository\igdlh64.inf_amd64_1ee0e91871b217e3\igd12umd64.dll szDriverNodeStrongName oem4.inf:5f63e5340a14bf6c:iSKLD_w10_DS:21.20.16.4534:pci\ven_8086&dev_191b&subsys_505017aa szDriverSignDate Unknown szDriverVersion 21.20.0016.4534 szKeyDeviceID Enum\PCI\VEN_8086&DEV_191B&SUBSYS_505017AA&REV_06 szKeyDeviceKey \Registry\Machine\System\CurrentControlSet\Control\Video\{06DF01E7-1286-11E8-B74A-954D83571B69}\0000 szManufacturer Intel Corporation szMiniVdd unknown szMiniVddDateEnglish Unknown szMiniVddDateLocalized unknown szMonitorMaxRes Unknown szMonitorName Wide viewing angle & High density FlexView Display 1920x1080 szNotesEnglish No problems found. szNotesLocalized No problems found. szOverlayEnglish Supported szRankOfInstalledDriver 00D10001 szRegHelpText Unknown szRevision Unknown szRevisionId 0x0006 szSubSysId 0x505017AA szTestResultD3D7English Not run szTestResultD3D7Localized Not run szTestResultD3D8English Not run szTestResultD3D8Localized Not run szTestResultD3D9English Not run szTestResultD3D9Localized Not run szTestResultDDEnglish Not run szTestResultDDLocalized Not run szVdd unknown szVendorId 0x8086 1 b3DAccelerationEnabled true b3DAccelerationExists true bAGPEnabled true bAGPExistenceValid false bAGPExists false bCanRenderWindow false bDDAccelerationEnabled true bDriverBeta false bDriverDebug false bDriverSigned false bDriverSignedValid false bNoHardware false dwBpp 0 dwDDIVersion 12 dwHeight 0 dwRefreshRate 0 dwWHQLLevel 0 dwWidth 0 iAdapter 0 lDriverSize 945560 lMiniVddSize 0 szAGPStatusEnglish Enabled szAGPStatusLocalized Enabled szChipType GeForce 940MX szD3DStatusEnglish Enabled szD3DStatusLocalized Enabled szDACType Integrated RAMDAC szDDIVersionEnglish 12 szDDIVersionLocalized 12 szDDStatusEnglish Enabled szDDStatusLocalized Enabled szDXVAHDEnglish Unknown szDXVAModes Unknown szDescription NVIDIA GeForce 940MX szDeviceId 0x134D szDeviceIdentifier Unknown szDeviceName Unknown szDisplayMemoryEnglish 6049 MB szDisplayMemoryLocalized 6049 MB szDisplayModeEnglish Unknown szDisplayModeLocalized unknown szDriverAssemblyVersion 23.21.13.8875 szDriverAttributes Final Retail szDriverDateEnglish 12/20/2017 2:00:00 AM szDriverDateLocalized 12/20/2017 02:00:00 szDriverLanguageEnglish English szDriverLanguageLocalized English szDriverModelEnglish WDDM 2.3 szDriverModelLocalized WDDM 2.3 szDriverName C:\WINDOWS\System32\DriverStore\FileRepository\nvlt.inf_amd64_d645963114baa101\nvldumdx.dll,C:\WINDOWS\System32\DriverStore\FileRepository\nvlt.inf_amd64_d645963114baa101\nvldumdx.dll,C:\WINDOWS\System32\DriverStore\FileRepository\nvlt.inf_amd64_d645963114baa101\nvldumdx.dll,C:\WINDOWS\System32\DriverStore\FileRepository\nvlt.inf_amd64_d645963114baa101\nvldumdx.dll szDriverNodeStrongName oem33.inf:0f066de3dcbc69ab:Section200:23.21.13.8875:pci\ven_10de&dev_134d&subsys_505017aa szDriverSignDate Unknown szDriverVersion 23.21.0013.8875 szKeyDeviceID Enum\PCI\VEN_10DE&DEV_134D&SUBSYS_505017AA&REV_A2 szKeyDeviceKey Unknown szManufacturer NVIDIA szMiniVdd unknown szMiniVddDateEnglish Unknown szMiniVddDateLocalized unknown szMonitorMaxRes Unknown szMonitorName Unknown szNotesEnglish No problems found. szNotesLocalized No problems found. szOverlayEnglish Unknown szRankOfInstalledDriver 00D10001 szRegHelpText Unknown szRevision Unknown szRevisionId 0x00A2 szSubSysId 0x505017AA szTestResultD3D7English Not run szTestResultD3D7Localized Not run szTestResultD3D8English Not run szTestResultD3D8Localized Not run szTestResultD3D9English Not run szTestResultD3D9Localized Not run szTestResultDDEnglish Not run szTestResultDDLocalized Not run szVdd unknown szVendorId 0x10DE Log Messages [1592:1404:0525/103715.159:WARNING:ipc_message_attachment_set.cc(49)] : MessageAttachmentSet destroyed with unconsumed attachments: 0/1 [1592:1404:0525/104435.475:ERROR:gles2_cmd_decoder.cc(12012)] : [.Offscreen-For-WebGL-000002215E3D0F60]GL ERROR :GL_INVALID_OPERATION : glReadPixels: format and type incompatible with the current read framebuffer [1592:1404:0525/104445.483:ERROR:gles2_cmd_decoder.cc(12012)] : [.Offscreen-For-WebGL-000002215E3D0F60]GL ERROR :GL_INVALID_OPERATION : glReadPixels: format and type incompatible with the current read framebuffer [1592:1404:0525/104720.328:WARNING:ipc_message_attachment_set.cc(49)] : MessageAttachmentSet destroyed with unconsumed attachments: 0/1 [1592:1404:0525/105917.728:WARNING:ipc_message_attachment_set.cc(49)] : MessageAttachmentSet destroyed with unconsumed attachments: 0/1 GpuProcessHostUIShim: The GPU process exited normally. Everything is okay. Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted May 25, 2018 Share Posted May 25, 2018 "Disabled Features: native_gpu_memory_buffers" what does that mean? Wish I knew more about the hardware stuff here... looks like its time to do some research. GpuMemoryBuffers Status ATC Software only ATCIA Software only DXT1 Software only DXT5 Software only ETC1 Software only R_8 Software only R_16 Software only RG_88 Software only BGR_565 Software only RGBA_4444 Software only RGBX_8888 GPU_READ, SCANOUT RGBA_8888 GPU_READ, SCANOUT BGRX_8888 Software only BGRX_1010102 Software only RGBX_1010102 Software only BGRA_8888 Software only RGBA_F16 Software only YVU_420 Software only YUV_420_BIPLANAR Software only UYVY_422 Software only Im pretty sure that is saying the GPU is not handling the buffers, but maybe I am mistaken. Quote Link to comment Share on other sites More sharing options...
Butterwell Posted May 25, 2018 Share Posted May 25, 2018 This *may* be standard for the ANGLE driver, since it's not a "real" driver but a shim/translator to Direct 11 calls. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.