Guest User

Untitled

a guest
Aug 13th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 35.80 KB | None | 0 0
  1. Game DLL requesting 256.00 mb of memory
  2. main: app path: F:\Users\BoltKey\Downloads\LudumDareToBeMessy\LudumDareToBeMessy
  3. main: data path: F:\Users\BoltKey\Downloads\LudumDareToBeMessy\LudumDareToBeMessy\data
  4. main: user path: F:\Users\BoltKey\Downloads\LudumDareToBeMessy\LudumDareToBeMessy
  5. processor architecture: x64
  6. processor count: 4
  7. processor type: x8664
  8. physical memory: 8,452,575,232 total / 2,133,983,232 available
  9. virtual memory: 2,147,352,576 total / 2,061,193,216 available
  10. drive: C:\ () 5,609,824,256 available out of 119,664,537,600 total
  11. drive: D:\ (Terra Mystica) 882,934,521,856 available out of 1,000,202,039,296 total
  12. drive: E:\ (System Reserved) 82,964,480 available out of 366,997,504 total
  13. drive: F:\ (Old Disk) 5,611,270,144 available out of 159,671,906,304 total
  14. drive: G:\ (G:\)
  15. display: \\.\DISPLAY1 (xy: 0, 0 / wh: 2560, 1440) refresh: 60 hz primary
  16. main: initializing 256.00 mb of memory
  17. OpenGL: creating DC
  18. OpenGL: setting pixel format
  19. OpenGL: creating OpenGL context
  20. OpenGL: setting context to current
  21. OpenGL: Vsync: false
  22. OpenGL: setting viewport
  23. OpenGL: version 4.5.0 NVIDIA 353.30
  24. OpenGL: vendor NVIDIA Corporation
  25. OpenGL: renderer GeForce GT 610/PCIe/SSE2
  26. OpenGL: shader version 4.50 NVIDIA
  27. OpenGL: extensions GL_AMD_multi_draw_indirect GL_ARB_arrays_of_arrays GL_ARB_base_instance 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_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_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_gpu_shader5 GL_ARB_gpu_shader_fp64 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_NV_internalformat_sample_query 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_pipeline_statistics_query GL_ARB_pixel_buffer_object GL_ARB_point_parameters GL_ARB_point_sprite GL_ARB_program_interface_query GL_ARB_provoking_vertex GL_ARB_robust_buffer_access_behavior GL_ARB_robustness 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_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_query_buffer_object 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_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_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_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_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_provoking_vertex GL_EXT_rescale_normal GL_EXT_secondary_color GL_EXT_separate_shader_objects GL_EXT_separate_specular_color GL_EXT_shader_image_load_store GL_EXT_shader_integer_mix GL_EXT_shadow_funcs 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_integer GL_EXT_texture_lod GL_EXT_texture_lod_bias GL_EXT_texture_mirror_clamp GL_EXT_texture_object GL_EXT_texture_shared_exponent GL_EXT_texture_sRGB 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_import_sync_object GL_IBM_rasterpos_clip GL_IBM_texture_mirrored_repeat GL_KHR_context_flush_control GL_KHR_debug GL_KHR_robust_buffer_access_behavior GL_KHR_robustness GL_KTX_buffer_region GL_NV_bindless_multi_draw_indirect GL_NV_bindless_multi_draw_indirect_count GL_NV_blend_equation_advanced GL_NV_blend_square GL_NV_command_list GL_NV_compute_program5 GL_NV_conditional_render 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_ES1_1_compatibility GL_NV_ES3_1_compatibility GL_NV_explicit_multisample GL_NV_fence GL_NV_float_buffer GL_NV_fog_distance GL_NV_fragment_program GL_NV_fragment_program_option GL_NV_fragment_program2 GL_NV_framebuffer_multisample_coverage GL_NV_geometry_shader4 GL_NV_gpu_program4 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_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_pixel_data_range GL_NV_point_sprite GL_NV_primitive_restart GL_NV_register_combiners GL_NV_register_combiners2 GL_NV_shader_atomic_counters GL_NV_shader_atomic_float GL_NV_shader_buffer_load GL_NV_shader_storage_buffer_object 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_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_NVX_conditional_render GL_NVX_gpu_memory_info GL_NV_shader_thread_group GL_KHR_blend_equation_advanced 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
  28. opengl: made texture (id: 1; fbo: 0; dim: 8 x 8)
  29. opengl: made texture (id: 2; fbo: 0; dim: 8 x 8)
  30. opengl: made texture (id: 3; fbo: 0; dim: 1024 x 128)
  31. zt_textureMake (from file data) took 5.380960 ms to execute
  32. asset_manager: loading directory: F:\Users\BoltKey\Downloads\LudumDareToBeMessy\LudumDareToBeMessy\data
  33. Loaded asset: textures/gui.png (41)
  34. loading texture asset: textures/gui.png (41)
  35. stbi_load_from_memory took 57.998302 ms to execute
  36. opengl: made texture (id: 4; fbo: 0; dim: 1024 x 1024)
  37. zt_textureMake (from asset) took 79.374290 ms to execute
  38. Loaded asset: textures/gui.spr (42)
  39. sprite manager: loading: textures/gui.spr (42)
  40. GuiManager allocated size: 26.75 mb
  41. opengl: made texture (id: 6; fbo: 1; dim: 1280 x 720)
  42. zt_textureMakeRenderTarget took 42.525894 ms to execute
  43. opengl: made texture (id: 11; fbo: 0; dim: 4 x 4)
  44. main: loading default shader: shader-bright
  45. main: loading default shader: shader-blur-horz
  46. main: loading default shader: shader-blur-vert
  47. opengl: made texture (id: 12; fbo: 6; dim: 1280 x 720)
  48. zt_textureMakeRenderTarget took 4.913545 ms to execute
  49. opengl: made texture (id: 13; fbo: 8; dim: 1280 x 720)
  50. zt_textureMakeRenderTarget took 3.091875 ms to execute
  51. opengl: made texture (id: 14; fbo: 10; dim: 1280 x 720)
  52. zt_textureMakeRenderTarget took 10.114751 ms to execute
  53. opengl: made texture (id: 15; fbo: 12; dim: 1280 x 720)
  54. zt_textureMakeRenderTarget took 5.744351 ms to execute
  55. Loaded asset: fonts/primary.fnt (27)
  56. loading texture asset: fonts/primary.png (28)
  57. stbi_load_from_memory took 11.748623 ms to execute
  58. opengl: made texture (id: 16; fbo: 0; dim: 512 x 512)
  59. zt_textureMake (from asset) took 19.822004 ms to execute
  60. main: Game initialized successfully
  61. main: Thread job queue initialized
  62. screen: 1280/720; native: 1280/720
  63. Loaded asset: textures/materials/floor.albedo.png (43)
  64. loading texture asset: textures/materials/floor.albedo.png (43)
  65. stbi_load_from_memory took 46.603085 ms to execute
  66. opengl: made texture (id: 17; fbo: 0; dim: 1024 x 1024)
  67. zt_textureMake (from asset) took 155.856430 ms to execute
  68. main: loading default shader: shader-unlit
  69. main: loading default shader: shader-solid
  70. Loaded asset: textures/materials/menu.albedo.png (44)
  71. loading texture asset: textures/materials/menu.albedo.png (44)
  72. stbi_load_from_memory took 43.434372 ms to execute
  73. opengl: made texture (id: 18; fbo: 0; dim: 1024 x 1024)
  74. zt_textureMake (from asset) took 165.586426 ms to execute
  75. Loaded asset: textures/materials/pallete.albedo.png (45)
  76. loading texture asset: textures/materials/pallete.albedo.png (45)
  77. stbi_load_from_memory took 80.513557 ms to execute
  78. opengl: made texture (id: 19; fbo: 0; dim: 1024 x 1024)
  79. zt_textureMake (from asset) took 106.962326 ms to execute
  80. Loaded asset: textures/materials/pallete.emissive.png (46)
  81. loading texture asset: textures/materials/pallete.emissive.png (46)
  82. stbi_load_from_memory took 36.243114 ms to execute
  83. opengl: made texture (id: 20; fbo: 0; dim: 1024 x 1024)
  84. zt_textureMake (from asset) took 65.569595 ms to execute
  85. Loaded asset: textures/materials/test_grid.albedo.png (47)
  86. loading texture asset: textures/materials/test_grid.albedo.png (47)
  87. stbi_load_from_memory took 41.928936 ms to execute
  88. opengl: made texture (id: 21; fbo: 0; dim: 1024 x 1024)
  89. zt_textureMake (from asset) took 76.716545 ms to execute
  90. Loaded asset: shaders/default.zts (35)
  91. Loaded asset: shaders/default_pbr.zts (36)
  92. glLinkProgram failed. Reason: Fragment info
  93. -------------
  94. 0(266) : error C5208: Sampler needs to be a uniform (global or parameter to main), need to inline function or resolve conditional expression
  95. 0(280) : error C5208: Sampler needs to be a uniform (global or parameter to main), need to inline function or resolve conditional expression
  96.  
  97. OpenGL: Unable to compile and link shader program.
  98. Failed vertex shader:
  99. #version 330 core
  100.  
  101. layout (location = 0) in vec3 _ztvv_position;
  102. layout (location = 1) in vec2 _ztvv_uv;
  103. layout (location = 2) in vec3 _ztvv_normal;
  104. layout (location = 3) in vec4 _ztvv_color;
  105. layout (location = 4) in vec4 _ztvv_tangent;
  106. layout (location = 5) in vec4 _ztvv_bitangent;
  107.  
  108. out PixelInput
  109. {
  110. vec4 position;
  111. vec3 frag_pos;
  112. vec4 frag_pos_light_space;
  113. vec3 normal;
  114. vec2 uv;
  115. vec4 color;
  116. vec4 frag_pos_view;
  117. vec3 normal_view;
  118. } _output;
  119.  
  120. uniform mat4 model;
  121. uniform mat4 view;
  122. uniform mat4 projection;
  123. uniform mat4 light_matrix;
  124.  
  125. void main()
  126. {
  127. mat4 model_mat = model;
  128. _output.position = projection * view * model_mat * vec4(_ztvv_position, 1.0);
  129. _output.frag_pos = vec3(model_mat * vec4(_ztvv_position, 1.0));
  130. _output.normal = mat3(model_mat) * _ztvv_normal;
  131. _output.uv = _ztvv_uv;
  132. _output.color = _ztvv_color;
  133. _output.frag_pos_light_space = light_matrix * vec4(_output.frag_pos, 1.0);
  134. _output.frag_pos_view = view * model_mat * vec4(_ztvv_position, 1);
  135. _output.normal_view = mat3(view) * mat3(model_mat) * _ztvv_normal;
  136. gl_Position = _output.position;
  137. }
  138.  
  139. Failed fragment shader:
  140. #version 330 core
  141.  
  142. layout (location = 0) out vec4 _ztfs_frag_color;
  143. layout (location = 1) out vec4 _ztfs_frag_position;
  144. layout (location = 2) out vec4 _ztfs_frag_normal;
  145.  
  146. in PixelInput
  147. {
  148. vec4 position;
  149. vec3 frag_pos;
  150. vec4 frag_pos_light_space;
  151. vec3 normal;
  152. vec2 uv;
  153. vec4 color;
  154. vec4 frag_pos_view;
  155. vec3 normal_view;
  156. } _input;
  157.  
  158. struct PointLight
  159. {
  160. vec3 pos;
  161. float intensity;
  162. vec3 ambient_color;
  163. int shadowmap_use;
  164. float far_plane;
  165. };
  166.  
  167. struct SpotLight
  168. {
  169. vec3 pos;
  170. float intensity;
  171. vec3 direction;
  172. float cutoff_in;
  173. float cutoff_out;
  174. vec3 ambient_color;
  175. int shadowmap_use;
  176. float far_plane;
  177. };
  178.  
  179. uniform vec3 view_pos;
  180. uniform float emissive_strength;
  181. uniform vec3 light_pos;
  182. uniform float light_ambient;
  183. uniform float light_intensity;
  184. uniform vec4 light_color;
  185. uniform PointLight point_lights[4];
  186. uniform int point_lights_count;
  187. uniform SpotLight spot_lights[4];
  188. uniform int spot_lights_count;
  189. uniform sampler2D diffuse_tex;
  190. uniform sampler2D specular_tex;
  191. uniform sampler2D normal_tex;
  192. uniform sampler2D emissive_tex;
  193. uniform samplerCube irradiance_map_tex;
  194. uniform samplerCube prefilter_map_tex;
  195. uniform sampler2D brdf_lut_tex;
  196. uniform sampler2D directional_light_shadowmap;
  197. uniform samplerCube point_lights_shadowmap[4];
  198. uniform samplerCube spot_lights_shadowmap[4];
  199.  
  200. vec3 fresnelSchlick(float cos_theta, vec3 v)
  201. {
  202. return v + (1.0 - v) * pow(1.0 - cos_theta, 3.0);
  203. }
  204.  
  205. vec3 fresnelSchlickRoughness(float cos_theta, vec3 v, float roughness)
  206. {
  207. return v + (max(vec3(1.0 - roughness), v) - v) * pow(1.0 - cos_theta, 3.0);
  208. }
  209.  
  210. float distributionGGX(vec3 n, vec3 h, float roughness)
  211. {
  212. float a = roughness * roughness;
  213. float a2 = a * a;
  214. float n_dot_h = max(dot(n, h), 0.0);
  215. float n_dot_h2 = n_dot_h * n_dot_h;
  216. float nom = a2;
  217. float denom = (n_dot_h2 * (a2 - 1.0) + 1.0);
  218. denom = 3.14159265359 * denom * denom;
  219. return nom / denom;
  220. }
  221.  
  222. float geometrySchlickGGX(float n_dot_v, float roughness)
  223. {
  224. float r = (roughness + 1.0);
  225. float k = (r * r) / 8.0;
  226. float nom = n_dot_v;
  227. float denom = n_dot_v * (1.0 - k) + k;
  228. return nom / denom;
  229. }
  230.  
  231. float geometrySmith(vec3 n, vec3 v, vec3 l, float roughness)
  232. {
  233. float n_dot_v = max(dot(n, v), 0.0);
  234. float n_dot_l = max(dot(n, l), 0.0);
  235. float ggx2 = geometrySchlickGGX(n_dot_v, roughness);
  236. float ggx1 = geometrySchlickGGX(n_dot_l, roughness);
  237. return ggx1 * ggx2;
  238. }
  239.  
  240. vec3 normalCalculation(vec2 uv)
  241. {
  242. vec3 tangent_normal = texture(normal_tex, uv).xyz;
  243. if (tangent_normal == vec3(1))
  244. {
  245. tangent_normal = _input.normal;
  246. return tangent_normal;
  247. }
  248. else
  249. {
  250. tangent_normal = tangent_normal * 2.0 - 1.0;
  251. }
  252. vec3 Q1 = dFdx(_input.position.xyz);
  253. vec3 Q2 = dFdy(_input.position.xyz);
  254. vec2 st1 = dFdx(uv);
  255. vec2 st2 = dFdy(uv);
  256. vec3 normal = normalize(_input.normal);
  257. vec3 T = normalize(Q1 * st2.y - Q2 * st1.y);
  258. vec3 B = -normalize(cross(normal, T));
  259. mat3 TBN = mat3(T, B, normal);
  260. return normalize(TBN * tangent_normal);
  261. }
  262.  
  263. float shadowCalculation(vec3 light_dir, vec3 normal)
  264. {
  265. vec3 proj_coords = _input.frag_pos_light_space.xyz / _input.frag_pos_light_space.w;
  266. proj_coords = proj_coords * 0.5 + 0.5;
  267. if (proj_coords.x < 0.0 || proj_coords.x > 1.0 || proj_coords.y < 0.0 || proj_coords.y > 1.0)
  268. {
  269. return 0.0;
  270. }
  271. float current_depth = proj_coords.z;
  272. if (current_depth > 1.0 || current_depth < 0.0)
  273. {
  274. return 0.0;
  275. }
  276. float bias = 0.005;
  277. float shadow = 0.0;
  278. vec2 texel_size = 1.0 / textureSize(directional_light_shadowmap, 0);
  279. const int samples = 3;
  280. for (int x = -samples; x <= samples; ++x)
  281. {
  282. for (int y = -samples; y <= samples; ++y)
  283. {
  284. float pcf_depth = texture(directional_light_shadowmap, proj_coords.xy + vec2(x, y) * texel_size).r;
  285. shadow += (((current_depth - bias) > pcf_depth) ? (1.0) : (0.0));
  286. }
  287. }
  288. shadow /= (float(samples) * 2.0 + 1.0) * (float(samples) * 2.0 + 1.0);
  289. return shadow;
  290. }
  291.  
  292. float shadowCalculationPointLight(PointLight light, samplerCube depth_tex, vec3 normal)
  293. {
  294. if (light.shadowmap_use == 0)
  295. {
  296. return 0;
  297. }
  298. vec3 frag_to_light = (_input.frag_pos - light.pos) * vec3(1, -1, -1);
  299. float current_depth = length(frag_to_light);
  300. float shadow = 0;
  301. float offset = 0.1;
  302. float bias = 0.05;
  303. int samples = 20;
  304. vec3 sample_offset_dir[20] = vec3[]( vec3(1, 1, 1), vec3(1, -1, 1), vec3(-1, -1, 1), vec3(-1, 1, 1), vec3(1, 1, -1), vec3(1, -1, -1), vec3(-1, -1, -1), vec3(-1, 1, -1), vec3(1, 1, 0), vec3(1, -1, 0), vec3(-1, -1, 0), vec3(-1, 1, 0), vec3(1, 0, 1), vec3(-1, 0, 1), vec3(1, 0, -1), vec3(-1, 0, -1), vec3(0, 1, 1), vec3(0, -1, 1), vec3(0, -1, -1), vec3(0, 1, -1) );
  305. float sample_offset_radius = 0.05;
  306. for (int i = 0; i < samples; ++i)
  307. {
  308. float closest_depth = texture(depth_tex, frag_to_light + sample_offset_dir[i] * sample_offset_radius).r;
  309. closest_depth *= light.far_plane;
  310. if (current_depth - bias > closest_depth)
  311. {
  312. shadow += 1;
  313. }
  314. }
  315. shadow /= float(samples);
  316. return shadow;
  317. }
  318.  
  319. float shadowCalculationSpotLight(SpotLight light, samplerCube depth_tex, vec3 normal)
  320. {
  321. if (light.shadowmap_use == 0)
  322. {
  323. return 0;
  324. }
  325. vec3 frag_to_light = (_input.frag_pos - light.pos) * vec3(1, -1, -1);
  326. float current_depth = length(frag_to_light);
  327. float shadow = 0;
  328. float offset = 0.1;
  329. float bias = 0.05;
  330. int samples = 20;
  331. vec3 sample_offset_dir[20] = vec3[]( vec3(1, 1, 1), vec3(1, -1, 1), vec3(-1, -1, 1), vec3(-1, 1, 1), vec3(1, 1, -1), vec3(1, -1, -1), vec3(-1, -1, -1), vec3(-1, 1, -1), vec3(1, 1, 0), vec3(1, -1, 0), vec3(-1, -1, 0), vec3(-1, 1, 0), vec3(1, 0, 1), vec3(-1, 0, 1), vec3(1, 0, -1), vec3(-1, 0, -1), vec3(0, 1, 1), vec3(0, -1, 1), vec3(0, -1, -1), vec3(0, 1, -1) );
  332. float sample_offset_radius = 0.05;
  333. for (int i = 0; i < samples; ++i)
  334. {
  335. float closest_depth = texture(depth_tex, frag_to_light + sample_offset_dir[i] * sample_offset_radius).r;
  336. closest_depth *= light.far_plane;
  337. if (current_depth - bias > closest_depth)
  338. {
  339. shadow += 1;
  340. }
  341. }
  342. shadow /= float(samples);
  343. return shadow;
  344. }
  345.  
  346. vec3 calculateLighting(vec3 light_dir, vec3 view_dir, vec3 normal, vec3 f0, vec3 light_pos, vec3 world_pos, vec3 light_color, float light_intensity, float shadow, vec3 albedo, float metallic, float roughness, bool directional)
  347. {
  348. vec3 H = normalize(view_dir + light_dir);
  349. vec3 radiance;
  350. if (directional)
  351. {
  352. float distance = 1;
  353. float attenuation = 1.0 / (distance * distance);
  354. radiance = light_color * attenuation * (1 - shadow) * light_intensity;
  355. }
  356. else
  357. {
  358. float distance = length(light_pos - world_pos);
  359. float attenuation = 1.0 / (distance * distance);
  360. radiance = light_color * attenuation * (1 - shadow) * light_intensity;
  361. }
  362. float NDF = distributionGGX(normal, H, roughness);
  363. float G = geometrySmith(normal, view_dir, light_dir, roughness);
  364. vec3 F = fresnelSchlick(max(dot(H, view_dir), 0.0), f0);
  365. vec3 nominator = NDF * G * F;
  366. float denominator = 4 * max(dot(normal, view_dir), 0.0) * max(dot(normal, light_dir), 0.0) + 0.001;
  367. vec3 specular = (nominator / denominator);
  368. vec3 kS = F;
  369. vec3 kD = vec3(1.0) - kS;
  370. kD *= 1.0 - metallic;
  371. float NdotL = max(dot(normal, light_dir), 0.0);
  372. return (kD * albedo / 3.14159265359 + specular) * radiance * NdotL;
  373. }
  374.  
  375. void main()
  376. {
  377. vec3 world_pos = _input.frag_pos;
  378. vec3 view_dir = normalize(view_pos - world_pos);
  379. vec3 albedo = pow(texture(diffuse_tex, _input.uv).rgb, vec3(2.2));
  380. float metallic = texture(specular_tex, _input.uv).g;
  381. float roughness = texture(specular_tex, _input.uv).r;
  382. float ao = .005;
  383. vec3 normal = normalCalculation(_input.uv);
  384. vec3 reflection = reflect(-view_dir, normal);
  385. vec3 F0 = vec3(0.04);
  386. F0 = mix(F0, albedo, metallic);
  387. vec3 Lo = vec3(0.0);
  388. if (true)
  389. {
  390. vec3 light_dir = normalize(light_pos);
  391. float shadow = shadowCalculation(light_dir, normal);
  392. vec4 light_color = light_color;
  393. Lo += calculateLighting(light_dir, view_dir, normal, F0, light_pos, vec3(0), light_color.rgb, light_intensity, shadow, albedo, metallic, roughness, true);
  394. }
  395. if (true)
  396. {
  397. for (int i = 0; i < 4; ++i)
  398. {
  399. if (i >= point_lights_count)
  400. {
  401. break;
  402. }
  403. PointLight light = point_lights[i];
  404. vec3 light_dir = normalize(light.pos - world_pos);
  405. float shadow = shadowCalculationPointLight(light, point_lights_shadowmap[i], normal);
  406. Lo += calculateLighting(light_dir, view_dir, normal, F0, light.pos, world_pos, light.ambient_color, light.intensity, shadow, albedo, metallic, roughness, false);
  407. }
  408. }
  409. if (true)
  410. {
  411. for (int i = 0; i < 4; ++i)
  412. {
  413. if (i >= spot_lights_count)
  414. {
  415. break;
  416. }
  417. SpotLight light = spot_lights[i];
  418. vec3 light_dir = normalize(light.pos - world_pos);
  419. float shadow = shadowCalculationSpotLight(light, spot_lights_shadowmap[i], normal);
  420. Lo += calculateLighting(light_dir, view_dir, normal, F0, light.pos, world_pos, light.ambient_color, light.intensity, shadow, albedo, metallic, roughness, false);
  421. }
  422. }
  423. vec3 F = fresnelSchlickRoughness(max(dot(normal, view_dir), 0.0), F0, roughness);
  424. vec3 kS = F;
  425. vec3 kD = 1.0 - kS;
  426. kD *= 1.0 - metallic;
  427. vec3 irradiance = texture(irradiance_map_tex, normal).rgb;
  428. vec3 diffuse = irradiance * albedo * light_ambient;
  429. const float MAX_REFLECTION_LOD = 4.0;
  430. vec3 prefilteredColor = textureLod(prefilter_map_tex, reflection, roughness * MAX_REFLECTION_LOD).rgb;
  431. vec2 brdf = texture(brdf_lut_tex, vec2(max(dot(normal, view_dir), 0.0), roughness)).xy;
  432. vec3 specular = prefilteredColor * (F * brdf.x + brdf.y);
  433. vec3 ambient = (kD * diffuse + specular) * ao;
  434. vec3 emissive = texture(emissive_tex, _input.uv).rgb;
  435. vec3 color = ambient + Lo;
  436. color += (emissive * emissive_strength);
  437. _ztfs_frag_color = vec4(color, 1.0);
  438. _ztfs_frag_position = _input.frag_pos_view;
  439. _ztfs_frag_normal = vec4(normalize(_input.normal_view), 1);
  440. }
  441.  
  442. Unable to make shader 'shaders/default_pbr.zts' (Unable to compile OpenGL shader program)
  443. Unable to load shader (shaders/default_pbr.zts). (null).
  444. Loaded asset: shaders/default_pbr_anim.zts (37)
  445. glLinkProgram failed. Reason: Fragment info
  446. -------------
  447. 0(266) : error C5208: Sampler needs to be a uniform (global or parameter to main), need to inline function or resolve conditional expression
  448. 0(280) : error C5208: Sampler needs to be a uniform (global or parameter to main), need to inline function or resolve conditional expression
  449.  
  450. OpenGL: Unable to compile and link shader program.
  451. Failed vertex shader:
  452. #version 330 core
  453.  
  454. layout (location = 0) in vec3 _ztvv_position;
  455. layout (location = 1) in vec2 _ztvv_uv;
  456. layout (location = 2) in vec3 _ztvv_normal;
  457. layout (location = 3) in vec4 _ztvv_color;
  458. layout (location = 4) in vec4 _ztvv_tangent;
  459. layout (location = 5) in vec4 _ztvv_bitangent;
  460. layout (location = 6) in ivec4 _ztvv_bones;
  461. layout (location = 7) in vec4 _ztvv_weights;
  462.  
  463. out PixelInput
  464. {
  465. vec4 position;
  466. vec3 frag_pos;
  467. vec4 frag_pos_light_space;
  468. vec3 normal;
  469. vec2 uv;
  470. vec4 color;
  471. vec4 frag_pos_view;
  472. vec3 normal_view;
  473. } _output;
  474.  
  475. uniform mat4 model;
  476. uniform mat4 view;
  477. uniform mat4 projection;
  478. uniform mat4 light_matrix;
  479. uniform mat4 bones[200];
  480. uniform int bones_count;
  481.  
  482. void main()
  483. {
  484. mat4 model_mat = model;
  485. if (bones_count > 0)
  486. {
  487. mat4 bone_mat = bones[_ztvv_bones.x] * _ztvv_weights.x;
  488. bone_mat += bones[_ztvv_bones.y] * _ztvv_weights.y;
  489. bone_mat += bones[_ztvv_bones.z] * _ztvv_weights.z;
  490. bone_mat += bones[_ztvv_bones.w] * _ztvv_weights.w;
  491. model_mat = model * bone_mat;
  492. }
  493. _output.position = projection * view * model_mat * vec4(_ztvv_position, 1.0);
  494. _output.frag_pos = vec3(model_mat * vec4(_ztvv_position, 1.0));
  495. _output.normal = mat3(model_mat) * _ztvv_normal;
  496. _output.uv = _ztvv_uv;
  497. _output.color = _ztvv_color;
  498. _output.frag_pos_light_space = light_matrix * vec4(_output.frag_pos, 1.0);
  499. _output.frag_pos_view = view * model_mat * vec4(_ztvv_position, 1);
  500. _output.normal_view = mat3(view) * mat3(model_mat) * _ztvv_normal;
  501. gl_Position = _output.position;
  502. }
  503.  
  504. Failed fragment shader:
  505. #version 330 core
  506.  
  507. layout (location = 0) out vec4 _ztfs_frag_color;
  508. layout (location = 1) out vec4 _ztfs_frag_position;
  509. layout (location = 2) out vec4 _ztfs_frag_normal;
  510.  
  511. in PixelInput
  512. {
  513. vec4 position;
  514. vec3 frag_pos;
  515. vec4 frag_pos_light_space;
  516. vec3 normal;
  517. vec2 uv;
  518. vec4 color;
  519. vec4 frag_pos_view;
  520. vec3 normal_view;
  521. } _input;
  522.  
  523. struct PointLight
  524. {
  525. vec3 pos;
  526. float intensity;
  527. vec3 ambient_color;
  528. int shadowmap_use;
  529. float far_plane;
  530. };
  531.  
  532. struct SpotLight
  533. {
  534. vec3 pos;
  535. float intensity;
  536. vec3 direction;
  537. float cutoff_in;
  538. float cutoff_out;
  539. vec3 ambient_color;
  540. int shadowmap_use;
  541. float far_plane;
  542. };
  543.  
  544. uniform vec3 view_pos;
  545. uniform float emissive_strength;
  546. uniform vec3 light_pos;
  547. uniform float light_ambient;
  548. uniform float light_intensity;
  549. uniform vec4 light_color;
  550. uniform PointLight point_lights[4];
  551. uniform int point_lights_count;
  552. uniform SpotLight spot_lights[4];
  553. uniform int spot_lights_count;
  554. uniform sampler2D diffuse_tex;
  555. uniform sampler2D specular_tex;
  556. uniform sampler2D normal_tex;
  557. uniform sampler2D emissive_tex;
  558. uniform samplerCube irradiance_map_tex;
  559. uniform samplerCube prefilter_map_tex;
  560. uniform sampler2D brdf_lut_tex;
  561. uniform sampler2D directional_light_shadowmap;
  562. uniform samplerCube point_lights_shadowmap[4];
  563. uniform samplerCube spot_lights_shadowmap[4];
  564.  
  565. vec3 fresnelSchlick(float cos_theta, vec3 v)
  566. {
  567. return v + (1.0 - v) * pow(1.0 - cos_theta, 3.0);
  568. }
  569.  
  570. vec3 fresnelSchlickRoughness(float cos_theta, vec3 v, float roughness)
  571. {
  572. return v + (max(vec3(1.0 - roughness), v) - v) * pow(1.0 - cos_theta, 3.0);
  573. }
  574.  
  575. float distributionGGX(vec3 n, vec3 h, float roughness)
  576. {
  577. float a = roughness * roughness;
  578. float a2 = a * a;
  579. float n_dot_h = max(dot(n, h), 0.0);
  580. float n_dot_h2 = n_dot_h * n_dot_h;
  581. float nom = a2;
  582. float denom = (n_dot_h2 * (a2 - 1.0) + 1.0);
  583. denom = 3.14159265359 * denom * denom;
  584. return nom / denom;
  585. }
  586.  
  587. float geometrySchlickGGX(float n_dot_v, float roughness)
  588. {
  589. float r = (roughness + 1.0);
  590. float k = (r * r) / 8.0;
  591. float nom = n_dot_v;
  592. float denom = n_dot_v * (1.0 - k) + k;
  593. return nom / denom;
  594. }
  595.  
  596. float geometrySmith(vec3 n, vec3 v, vec3 l, float roughness)
  597. {
  598. float n_dot_v = max(dot(n, v), 0.0);
  599. float n_dot_l = max(dot(n, l), 0.0);
  600. float ggx2 = geometrySchlickGGX(n_dot_v, roughness);
  601. float ggx1 = geometrySchlickGGX(n_dot_l, roughness);
  602. return ggx1 * ggx2;
  603. }
  604.  
  605. vec3 normalCalculation(vec2 uv)
  606. {
  607. vec3 tangent_normal = texture(normal_tex, uv).xyz;
  608. if (tangent_normal == vec3(1))
  609. {
  610. tangent_normal = _input.normal;
  611. return tangent_normal;
  612. }
  613. else
  614. {
  615. tangent_normal = tangent_normal * 2.0 - 1.0;
  616. }
  617. vec3 Q1 = dFdx(_input.position.xyz);
  618. vec3 Q2 = dFdy(_input.position.xyz);
  619. vec2 st1 = dFdx(uv);
  620. vec2 st2 = dFdy(uv);
  621. vec3 normal = normalize(_input.normal);
  622. vec3 T = normalize(Q1 * st2.y - Q2 * st1.y);
  623. vec3 B = -normalize(cross(normal, T));
  624. mat3 TBN = mat3(T, B, normal);
  625. return normalize(TBN * tangent_normal);
  626. }
  627.  
  628. float shadowCalculation(vec3 light_dir, vec3 normal)
  629. {
  630. vec3 proj_coords = _input.frag_pos_light_space.xyz / _input.frag_pos_light_space.w;
  631. proj_coords = proj_coords * 0.5 + 0.5;
  632. if (proj_coords.x < 0.0 || proj_coords.x > 1.0 || proj_coords.y < 0.0 || proj_coords.y > 1.0)
  633. {
  634. return 0.0;
  635. }
  636. float current_depth = proj_coords.z;
  637. if (current_depth > 1.0 || current_depth < 0.0)
  638. {
  639. return 0.0;
  640. }
  641. float bias = max(0.005 * (1.0 - dot(normal, light_dir)), 0.005);
  642. float shadow = 0.0;
  643. vec2 texel_size = 1.0 / textureSize(directional_light_shadowmap, 0);
  644. const int samples = 3;
  645. for (int x = -samples; x <= samples; ++x)
  646. {
  647. for (int y = -samples; y <= samples; ++y)
  648. {
  649. float pcf_depth = texture(directional_light_shadowmap, proj_coords.xy + vec2(x, y) * texel_size).r;
  650. shadow += (((current_depth - bias) > pcf_depth) ? (1.0) : (0.0));
  651. }
  652. }
  653. shadow /= (float(samples) * 2.0 + 1.0) * (float(samples) * 2.0 + 1.0);
  654. return shadow;
  655. }
  656.  
  657. float shadowCalculationPointLight(PointLight light, samplerCube depth_tex, vec3 normal)
  658. {
  659. if (light.shadowmap_use == 0)
  660. {
  661. return 0;
  662. }
  663. vec3 frag_to_light = (_input.frag_pos - light.pos) * vec3(1, -1, -1);
  664. float current_depth = length(frag_to_light);
  665. float shadow = 0;
  666. float offset = 0.1;
  667. float bias = 0.05;
  668. int samples = 20;
  669. vec3 sample_offset_dir[20] = vec3[]( vec3(1, 1, 1), vec3(1, -1, 1), vec3(-1, -1, 1), vec3(-1, 1, 1), vec3(1, 1, -1), vec3(1, -1, -1), vec3(-1, -1, -1), vec3(-1, 1, -1), vec3(1, 1, 0), vec3(1, -1, 0), vec3(-1, -1, 0), vec3(-1, 1, 0), vec3(1, 0, 1), vec3(-1, 0, 1), vec3(1, 0, -1), vec3(-1, 0, -1), vec3(0, 1, 1), vec3(0, -1, 1), vec3(0, -1, -1), vec3(0, 1, -1) );
  670. float sample_offset_radius = 0.05;
  671. for (int i = 0; i < samples; ++i)
  672. {
  673. float closest_depth = texture(depth_tex, frag_to_light + sample_offset_dir[i] * sample_offset_radius).r;
  674. closest_depth *= light.far_plane;
  675. if (current_depth - bias > closest_depth)
  676. {
  677. shadow += 1;
  678. }
  679. }
  680. shadow /= float(samples);
  681. return shadow;
  682. }
  683.  
  684. float shadowCalculationSpotLight(SpotLight light, samplerCube depth_tex, vec3 normal)
  685. {
  686. if (light.shadowmap_use == 0)
  687. {
  688. return 0;
  689. }
  690. vec3 frag_to_light = (_input.frag_pos - light.pos) * vec3(1, -1, -1);
  691. float current_depth = length(frag_to_light);
  692. float shadow = 0;
  693. float offset = 0.1;
  694. float bias = 0.05;
  695. int samples = 20;
  696. vec3 sample_offset_dir[20] = vec3[]( vec3(1, 1, 1), vec3(1, -1, 1), vec3(-1, -1, 1), vec3(-1, 1, 1), vec3(1, 1, -1), vec3(1, -1, -1), vec3(-1, -1, -1), vec3(-1, 1, -1), vec3(1, 1, 0), vec3(1, -1, 0), vec3(-1, -1, 0), vec3(-1, 1, 0), vec3(1, 0, 1), vec3(-1, 0, 1), vec3(1, 0, -1), vec3(-1, 0, -1), vec3(0, 1, 1), vec3(0, -1, 1), vec3(0, -1, -1), vec3(0, 1, -1) );
  697. float sample_offset_radius = 0.05;
  698. for (int i = 0; i < samples; ++i)
  699. {
  700. float closest_depth = texture(depth_tex, frag_to_light + sample_offset_dir[i] * sample_offset_radius).r;
  701. closest_depth *= light.far_plane;
  702. if (current_depth - bias > closest_depth)
  703. {
  704. shadow += 1;
  705. }
  706. }
  707. shadow /= float(samples);
  708. return shadow;
  709. }
  710.  
  711. vec3 calculateLighting(vec3 light_dir, vec3 view_dir, vec3 normal, vec3 f0, vec3 light_pos, vec3 world_pos, vec3 light_color, float light_intensity, float shadow, vec3 albedo, float metallic, float roughness, bool directional)
  712. {
  713. vec3 H = normalize(view_dir + light_dir);
  714. vec3 radiance;
  715. if (directional)
  716. {
  717. float distance = 1;
  718. float attenuation = 1.0 / (distance * distance);
  719. radiance = light_color * attenuation * (1 - shadow) * light_intensity;
  720. }
  721. else
  722. {
  723. float distance = length(light_pos - world_pos);
  724. float attenuation = 1.0 / (distance * distance);
  725. radiance = light_color * attenuation * (1 - shadow) * light_intensity;
  726. }
  727. float NDF = distributionGGX(normal, H, roughness);
  728. float G = geometrySmith(normal, view_dir, light_dir, roughness);
  729. vec3 F = fresnelSchlick(max(dot(H, view_dir), 0.0), f0);
  730. vec3 nominator = NDF * G * F;
  731. float denominator = 4 * max(dot(normal, view_dir), 0.0) * max(dot(normal, light_dir), 0.0) + 0.001;
  732. vec3 specular = (nominator / denominator);
  733. vec3 kS = F;
  734. vec3 kD = vec3(1.0) - kS;
  735. kD *= 1.0 - metallic;
  736. float NdotL = max(dot(normal, light_dir), 0.0);
  737. return (kD * albedo / 3.14159265359 + specular) * radiance * NdotL;
  738. }
  739.  
  740. void main()
  741. {
  742. vec3 world_pos = _input.frag_pos;
  743. vec3 view_dir = normalize(view_pos - world_pos);
  744. vec3 albedo = pow(texture(diffuse_tex, _input.uv).rgb, vec3(2.2));
  745. float metallic = texture(specular_tex, _input.uv).g;
  746. float roughness = texture(specular_tex, _input.uv).r;
  747. float ao = .005;
  748. vec3 normal = normalCalculation(_input.uv);
  749. vec3 reflection = reflect(-view_dir, normal);
  750. vec3 F0 = vec3(0.04);
  751. F0 = mix(F0, albedo, metallic);
  752. vec3 Lo = vec3(0.0);
  753. if (true)
  754. {
  755. vec3 light_dir = normalize(light_pos);
  756. float shadow = shadowCalculation(light_dir, normal);
  757. vec4 light_color = light_color;
  758. Lo += calculateLighting(light_dir, view_dir, normal, F0, light_pos, vec3(0), light_color.rgb, light_intensity, shadow, albedo, metallic, roughness, true);
  759. }
  760. if (true)
  761. {
  762. for (int i = 0; i < 4; ++i)
  763. {
  764. if (i >= point_lights_count)
  765. {
  766. break;
  767. }
  768. PointLight light = point_lights[i];
  769. vec3 light_dir = normalize(light.pos - world_pos);
  770. float shadow = shadowCalculationPointLight(light, point_lights_shadowmap[i], normal);
  771. Lo += calculateLighting(light_dir, view_dir, normal, F0, light.pos, world_pos, light.ambient_color, light.intensity, shadow, albedo, metallic, roughness, false);
  772. }
  773. }
  774. if (true)
  775. {
  776. for (int i = 0; i < 4; ++i)
  777. {
  778. if (i >= spot_lights_count)
  779. {
  780. break;
  781. }
  782. SpotLight light = spot_lights[i];
  783. vec3 light_dir = normalize(light.pos - world_pos);
  784. float shadow = shadowCalculationSpotLight(light, spot_lights_shadowmap[i], normal);
  785. Lo += calculateLighting(light_dir, view_dir, normal, F0, light.pos, world_pos, light.ambient_color, light.intensity, shadow, albedo, metallic, roughness, false);
  786. }
  787. }
  788. vec3 F = fresnelSchlickRoughness(max(dot(normal, view_dir), 0.0), F0, roughness);
  789. vec3 kS = F;
  790. vec3 kD = 1.0 - kS;
  791. kD *= 1.0 - metallic;
  792. vec3 irradiance = texture(irradiance_map_tex, normal).rgb;
  793. vec3 diffuse = albedo * light_ambient;
  794. const float MAX_REFLECTION_LOD = 4.0;
  795. vec3 prefilteredColor = textureLod(prefilter_map_tex, reflection, roughness * MAX_REFLECTION_LOD).rgb;
  796. vec2 brdf = texture(brdf_lut_tex, vec2(max(dot(normal, view_dir), 0.0), roughness)).xy;
  797. vec3 specular = prefilteredColor * (F * brdf.x + brdf.y);
  798. vec3 ambient = (kD * diffuse + specular) * ao;
  799. vec3 emissive = texture(emissive_tex, _input.uv).rgb;
  800. vec3 color = ambient + Lo;
  801. color += (emissive * emissive_strength);
  802. _ztfs_frag_color = vec4(color, 1.0);
  803. _ztfs_frag_position = _input.frag_pos_view;
  804. _ztfs_frag_normal = vec4(normalize(_input.normal_view), 1);
  805. }
  806.  
  807. Unable to make shader 'shaders/default_pbr_anim.zts' (Unable to compile OpenGL shader program)
  808. Unable to load shader (shaders/default_pbr_anim.zts). (null).
  809. Loaded asset: shaders/menu.zts (38)
  810. opengl: made texture (id: 22; fbo: 13; dim: 4096 x 4096)
  811. zt_textureMakeRenderTarget took 10.027925 ms to execute
  812. Loaded asset: textures/environment.hdr (40)
  813. loading texture asset: textures/environment.hdr (40)
  814. stbi_loadf_from_memory took 414.231842 ms to execute
  815. opengl: made texture (id: 23; fbo: 0; dim: 2048 x 1024)
  816. zt_textureMake (from asset) took 622.804077 ms to execute
Advertisement
Add Comment
Please, Sign In to add comment