q3ds.studio3d: creating engine Requesting OpenGL 3.3 core context succeeded Actual format is QSurfaceFormat(version 4.1, options QFlags(), depthBufferSize 0, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize -1, stencilBufferSize 0, samples 0, swapBehavior QSurfaceFormat::DoubleBuffer, swapInterval 1, colorSpace QSurfaceFormat::DefaultColorSpace, profile QSurfaceFormat::CoreProfile) renderer: Intel(R) Iris(TM) Graphics 550 vendor: Intel Inc. version: 4.1 INTEL-10.36.19 use feature-limited GLES2 rendering path: false max lights per layer: 16 GL_MAX_DRAW_BUFFERS: 8 multisample textures: true texture lod: true packed depth-stencil: true norm16 textures: true extensions: QSet("GL_ARB_transform_feedback2", "GL_ARB_draw_indirect", "GL_ARB_shader_subroutine", "GL_NV_texture_barrier", "GL_ARB_texture_query_lod", "GL_ARB_separate_shader_objects", "GL_APPLE_rgb_422", "GL_ARB_blend_func_extended", "GL_EXT_framebuffer_multisample_blit_scaled", "GL_ARB_tessellation_shader", "GL_ARB_gpu_shader5", "GL_ARB_shading_language_include", "GL_ARB_texture_swizzle", "GL_ARB_vertex_type_2_10_10_10_rev", "GL_EXT_debug_label", "GL_ARB_ES2_compatibility", "GL_ARB_shader_bit_encoding", "GL_EXT_texture_compression_s3tc", "GL_ARB_texture_cube_map_array", "GL_ARB_viewport_array", "GL_ARB_vertex_attrib_64bit", "GL_APPLE_object_purgeable", "GL_APPLE_texture_range", "GL_ARB_sampler_objects", "GL_EXT_debug_marker", "GL_APPLE_row_bytes", "GL_ARB_texture_rgb10_a2ui", "GL_APPLE_flush_render", "GL_ARB_gpu_shader_fp64", "GL_APPLE_client_storage", "GL_ARB_texture_gather", "GL_APPLE_container_object_shareable", "GL_EXT_texture_filter_anisotropic", "GL_ARB_explicit_attrib_location", "GL_ARB_occlusion_query2", "GL_ARB_transform_feedback3", "GL_ARB_internalformat_query", "GL_ARB_texture_storage", "GL_ARB_texture_buffer_object_rgb32", "GL_ARB_instanced_arrays", "GL_EXT_texture_sRGB_decode", "GL_ARB_draw_buffers_blend", "GL_ARB_timer_query", "GL_ATI_texture_mirror_once", "GL_ARB_sample_shading") q3ds.studio3d: Adopting surface format from QQuickWindow: QSurfaceFormat(version 2.0, options QFlags(), depthBufferSize 24, redBufferSize -1, greenBufferSize -1, blueBufferSize -1, alphaBufferSize -1, stencilBufferSize 8, samples -1, swapBehavior QSurfaceFormat::DoubleBuffer, swapInterval 1, colorSpace QSurfaceFormat::DefaultColorSpace, profile QSurfaceFormat::NoProfile) Actual format is QSurfaceFormat(version 2.1, options QFlags(DeprecatedFunctions), depthBufferSize 24, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize -1, stencilBufferSize 8, samples 0, swapBehavior QSurfaceFormat::DoubleBuffer, swapInterval 1, colorSpace QSurfaceFormat::DefaultColorSpace, profile QSurfaceFormat::NoProfile) renderer: Intel(R) Iris(TM) Graphics 550 vendor: Intel Inc. version: 2.1 INTEL-10.36.19 use feature-limited GLES2 rendering path: false max lights per layer: 16 GL_MAX_DRAW_BUFFERS: 8 multisample textures: false texture lod: true packed depth-stencil: true norm16 textures: true extensions: QSet("GL_ARB_provoking_vertex", "GL_ARB_vertex_blend", "GL_APPLE_pixel_buffer", "GL_NV_fog_distance", "GL_EXT_stencil_two_side", "GL_EXT_transform_feedback", "GL_ARB_draw_instanced", "GL_EXT_draw_range_elements", "GL_ARB_draw_elements_base_vertex", "GL_EXT_texture_sRGB", "GL_APPLE_row_bytes", "GL_ATI_texture_float", "GL_EXT_gpu_shader4", "GL_EXT_texture_compression_s3tc", "GL_EXT_provoking_vertex", "GL_ARB_fragment_shader", "GL_APPLE_element_array", "GL_ATI_texture_mirror_once", "GL_ARB_occlusion_query", "GL_ARB_sync", "GL_APPLE_ycbcr_422", "GL_ARB_shading_language_100", "GL_APPLE_client_storage", "GL_EXT_debug_label", "GL_ARB_framebuffer_object", "GL_ARB_point_sprite", "GL_SGIS_texture_edge_clamp", "GL_ARB_multitexture", "GL_ARB_texture_non_power_of_two", "GL_APPLE_packed_pixels", "GL_ARB_draw_buffers", "GL_ARB_texture_env_add", "GL_ARB_texture_float", "GL_ARB_shadow", "GL_EXT_debug_marker", "GL_EXT_framebuffer_multisample", "GL_EXT_multi_draw_arrays", "GL_EXT_texture_env_add", "GL_ARB_point_parameters", "", "GL_EXT_blend_func_separate", "GL_EXT_texture_array", "GL_EXT_framebuffer_blit", "GL_ARB_seamless_cube_map", "GL_ARB_texture_compression_rgtc", "GL_EXT_texture_integer", "GL_EXT_fog_coord", "GL_EXT_framebuffer_object", "GL_ARB_texture_env_crossbar", "GL_ARB_vertex_buffer_object", "GL_APPLE_aux_depth_stencil", "GL_ARB_texture_mirrored_repeat", "GL_EXT_blend_color", "GL_APPLE_vertex_array_range", "GL_EXT_shadow_funcs", "GL_APPLE_flush_buffer_range", "GL_EXT_texture_shared_exponent", "GL_ARB_texture_cube_map", "GL_EXT_blend_equation_separate", "GL_NV_texture_barrier", "GL_ARB_half_float_vertex", "GL_EXT_draw_buffers2", "GL_EXT_blend_minmax", "GL_NV_blend_square", "GL_NV_depth_clamp", "GL_APPLE_object_purgeable", "GL_NV_texgen_reflection", "GL_ATI_separate_stencil", "GL_ARB_transpose_matrix", "GL_EXT_gpu_program_parameters", "GL_APPLE_rgb_422", "GL_EXT_texture_compression_dxt1", "GL_APPLE_vertex_array_object", "GL_EXT_blend_subtract", "GL_ARB_vertex_program", "GL_APPLE_vertex_point_size", "GL_ARB_texture_env_dot3", "GL_ATI_texture_env_combine3", "GL_ARB_vertex_array_bgra", "GL_APPLE_specular_vector", "GL_EXT_packed_depth_stencil", "GL_EXT_packed_float", "GL_SGIS_generate_mipmap", "GL_ARB_texture_rg", "GL_EXT_rescale_normal", "GL_ARB_framebuffer_sRGB", "GL_EXT_vertex_array_bgra", "GL_APPLE_texture_range", "GL_APPLE_float_pixels", "GL_ARB_half_float_pixel", "GL_EXT_texture_rectangle", "GL_APPLE_flush_render", "GL_ARB_depth_buffer_float", "GL_EXT_abgr", "GL_EXT_clip_volume_hint", "GL_EXT_texture_lod_bias", "GL_ARB_color_buffer_float", "GL_ARB_shader_texture_lod", "GL_ARB_texture_env_combine", "GL_ARB_texture_rectangle", "GL_EXT_timer_query", "GL_ARB_window_pos", "GL_ARB_fragment_program_shadow", "GL_ARB_shader_objects", "GL_EXT_separate_specular_color", "GL_APPLE_vertex_program_evaluators", "GL_EXT_framebuffer_multisample_blit_scaled", "GL_EXT_secondary_color", "GL_ARB_texture_compression", "GL_APPLE_transform_hint", "GL_ARB_pixel_buffer_object", "GL_NV_light_max_exponent", "GL_ARB_multisample", "GL_SGIS_texture_lod", "GL_EXT_bgra", "GL_ARB_instanced_arrays", "GL_EXT_stencil_wrap", "GL_ARB_depth_clamp", "GL_ARB_fragment_program", "GL_EXT_texture_filter_anisotropic", "GL_EXT_geometry_shader4", "GL_APPLE_fence", "GL_EXT_texture_sRGB_decode", "GL_NV_conditional_render", "GL_ARB_depth_texture", "GL_EXT_framebuffer_sRGB", "GL_IBM_rasterpos_clip", "GL_ARB_texture_border_clamp", "GL_ARB_vertex_shader") q3ds.studio3d: created engine 0x7fa244404140 q3ds.studio3d: source is now ":/dataInputQmlStream/dataInputQmlStream.uia" q3ds.scene: prepareEngineResetGlobal q3ds.perf: :/dataInputQmlStream/dataInputQmlStream.uia loaded in 0 ms q3ds.uip: Registered subpresentation :/dataInputQmlStream/presentations/dataInputQmlStream.uip as dataInputQmlStream q3ds.uip: Registered qml subpresentation :/dataInputQmlStream/qml streams/rectangle.qml as rectangle q3ds.uip: Registered 1 data input entries q3ds.uip: Registered 1 inline qml subpresentations q3ds.uip: "rectangle" QQuickItem(0x7fa2445f57d0, parent=0x0, geometry=0,0 256x256) q3ds.uip: Loaded data model metadata from :/q3ds/res/DataModelMetadata/en-us/MetaData.xml q3ds.perf: Mesh #Rectangle loaded in 0 ms q3ds.perf: Presentation :/dataInputQmlStream/presentations/dataInputQmlStream.uip loaded in 3 ms q3ds.scene: Registered font TitilliumWeb-Regular with family Titillium Web q3ds.scene: Building scene for ":/dataInputQmlStream/presentations/dataInputQmlStream.uip" SceneBuilderParams( QFlags() QSize(480, 480) 1 QQuickWindowQmlImpl(0x7fa2445f2ca0) ) q3ds.scene: Render target depth-stencil attachment uses D24S8 q3ds.scene: Render target depth-stencil attachment uses D24S8 q3ds.scene: Render target depth-stencil attachment uses D24S8 q3ds.perf: Composing 1 layers in presentation dataInputQmlStream.uip q3ds.scene: Generating compositor quad for Layer with logical depth 1 q3ds.scene: Kicking off slide system q3ds.slideplayer: Setting slide deck with 1 slides q3ds.slideplayer: Changing state for Scene-Master to Ready q3ds.slideplayer: Changing state for Scene-Slide1 to Ready q3ds.scene: buildScene done q3ds.scene: Resize to QSize(480, 480) with viewport QRect(0,0 480x480) device pixel ratio 1 q3ds.scene: Directing subpresentation rectangle to image materials/rectangle_diffusemap q3ds.perf: Using a subpresentation as texture map (not as layer) makes layer caching in main presentation less efficient q3ds.scene: finalizeMainScene q3ds.uip: Found 0 behavior instances in total q3ds.uip: Aspect engine reset q3ds.slideplayer: Checking visibility for "Scene-Slide1" q3ds.slideplayer: The slides's ("Scene-Slide1") visibility is 1 q3ds.slideplayer: Changing state for Scene-Master to Playing q3ds.slideplayer: Changing state for Scene-Slide1 to Playing q3ds.slideplayer: Scheduling object "Layer" to be shown at 0.0s q3ds.slideplayer: Scheduling object "Camera" to be shown at 0.0s q3ds.slideplayer: Scheduling object "Light" to be shown at 0.0s q3ds.scene: Layer Layer uses camera Camera q3ds.slideplayer: Scheduling object "rectangle" to be shown at 0.0s q3ds.slideplayer: Scheduling object "Text" to be shown at 0.0s q3ds.perf: Total setSource time (incl. subpresentations + Qt3D scene building): 168 ms q3ds.scene: Resize to QSize(500, 500) with viewport QRect(0,0 500x500) device pixel ratio 2 q3ds.studio3d: Setting external render target size on surface selector 0x7fa244486c70 q3ds.studio3d: [R] new renderer 0x7fa2446aeb10, window is 0x7fa2445f2ca0, context is 0x7fa244742d00, aspect engine 0x7fa2446882a0 q3ds.perf: Presentation dataInputQmlStream.uip: Time from the end of Qt3D scene building until first frame action: 286 ms q3ds.slideplayer: Scheduling object "Light" to be shown at 0.4s DepthStencil Attachment not supported on OpenGL 2.0 QOpenGLShader::compile(Vertex): ERROR: 0:1: '' : version '150' is not supported ERROR: 0:1: '' : syntax error: #version *** Problematic Vertex shader source code *** #version 150 core #define lowp #define mediump #define highp #line 1 in vec4 vCoord; in vec2 tCoord; out vec2 sampleCoord; out vec2 alphas; uniform mat4 mvp; uniform mat4 modelView; uniform int textureWidth; uniform int textureHeight; uniform float fontScale; float thresholdFunc(float scale) { float base = 0.5; float baseDev = 0.065; float devScaleMin = 0.15; float devScaleMax = 0.3; return base - ((clamp(scale, devScaleMin, devScaleMax) - devScaleMin) / (devScaleMax - devScaleMin) * -baseDev + baseDev); } float spreadFunc(float scale) { return 0.06 / scale; } vec2 alphaRange(float scale) { float base = thresholdFunc(scale); float range = spreadFunc(scale); float alphaMin = max(0.0, base - range); float alphaMax = min(base + range, 1.0); return vec2(alphaMin, alphaMax); } void main() { float scale = fontScale * sqrt(abs(determinant(modelView))); alphas = alphaRange(scale); sampleCoord = tCoord * vec2(1.0 / textureWidth, 1.0 / textureHeight); gl_Position = mvp * vCoord; } *** QOpenGLShader::compile(Fragment): ERROR: 0:1: '' : version '150' is not supported ERROR: 0:1: '' : syntax error: #version *** Problematic Fragment shader source code *** #version 150 core #ifdef GL_KHR_blend_equation_advanced #extension GL_ARB_fragment_coord_conventions : enable #extension GL_KHR_blend_equation_advanced : enable #endif #define lowp #define mediump #define highp #line 1 in vec2 sampleCoord; out vec4 fragColor; uniform sampler2D _qt_texture; uniform vec4 color; in vec2 alphas; void main() { fragColor = color * smoothstep(alphas.x, alphas.y, texture(_qt_texture, sampleCoord).r); } *** QOpenGLShader::compile(Fragment): ERROR: 0:7: Invalid storage qualifiers 'in' in global variable context ERROR: 0:12: Use of undeclared identifier 'outDepth' ERROR: 0:13: Use of undeclared identifier 'fragOutput' ERROR: 0:13: Use of undeclared identifier 'depth' *** Problematic Fragment shader source code *** #version 110 #ifdef GL_KHR_blend_equation_advanced #extension GL_ARB_fragment_coord_conventions : enable #extension GL_KHR_blend_equation_advanced : enable #endif #define lowp #define mediump #define highp #line 1 #define GLSL_100 1 #define GLSL_130 0 #define MAX_NUM_LIGHTS 16 #define MAX_AREA_LIGHTS 16 in vec3 outDepth; void main() { float depth = (outDepth.x + 1.0) * 0.5; fragOutput = vec4(depth); } *** QOpenGLShader::compile(Fragment): ERROR: 0:7: Invalid storage qualifiers 'in' in global variable context ERROR: 0:15: Use of undeclared identifier 'world_pos' ERROR: 0:16: Use of undeclared identifier 'dist' ERROR: 0:16: Use of undeclared identifier 'dist' ERROR: 0:17: Use of undeclared identifier 'fragOutput' ERROR: 0:17: Use of undeclared identifier 'dist' ERROR: 0:17: Use of undeclared identifier 'dist' ERROR: 0:17: Use of undeclared identifier 'dist' *** Problematic Fragment shader source code *** #version 110 #ifdef GL_KHR_blend_equation_advanced #extension GL_ARB_fragment_coord_conventions : enable #extension GL_KHR_blend_equation_advanced : enable #endif #define lowp #define mediump #define highp #line 1 #define GLSL_100 1 #define GLSL_130 0 #define MAX_NUM_LIGHTS 16 #define MAX_AREA_LIGHTS 16 in vec4 world_pos; uniform vec3 camera_position; uniform vec2 camera_properties; void main() { vec3 camPos = vec3( camera_position.x, camera_position.y, -camera_position.z ); float dist = length( world_pos.xyz - camPos ); dist = (dist - camera_properties.x) / (camera_properties.y - camera_properties.x); fragOutput = vec4(dist, dist, dist, 1.0); } *** QOpenGLShader::compile(Fragment): ERROR: 0:11: Use of undeclared identifier 'fragOutput' *** Problematic Fragment shader source code *** #version 110 #ifdef GL_KHR_blend_equation_advanced #extension GL_ARB_fragment_coord_conventions : enable #extension GL_KHR_blend_equation_advanced : enable #endif #define lowp #define mediump #define highp #line 1 #define GLSL_100 1 #define GLSL_130 0 #define MAX_NUM_LIGHTS 16 #define MAX_AREA_LIGHTS 16 void main() { fragOutput = vec4(0.0); } *** QOpenGLShader::compile(Fragment): ERROR: 0:37: 'layout' : syntax error: syntax error *** Problematic Fragment shader source code *** #version 110 #ifdef GL_KHR_blend_equation_advanced #extension GL_ARB_fragment_coord_conventions : enable #extension GL_KHR_blend_equation_advanced : enable #endif #define lowp #define mediump #define highp #line 1 #define GLSL_100 1 #define GLSL_130 0 #define QT3DS_ENABLE_CG_LIGHTING 1 #define QT3DS_ENABLE_IBL_FOV 0 #define QT3DS_ENABLE_LIGHT_PROBE 0 #define QT3DS_ENABLE_LIGHT_PROBE_2 0 #define QT3DS_ENABLE_SSDO 0 #define QT3DS_ENABLE_SSM 0 #define QT3DS_ENABLE_SSAO 0 #define MAX_NUM_LIGHTS 16 #define MAX_AREA_LIGHTS 16 // begin "funcsampleLightVars.glsllib" struct LightSource { vec4 position; vec4 direction; // Specifies the light direction in world coordinates. vec4 up; vec4 right; vec4 diffuse; vec4 ambient; vec4 specular; float spotExponent; // Specifies the intensity distribution of the light. float spotCutoff; // Specifies the maximum spread angle of the light. float constantAttenuation; // Specifies the constant light attenuation factor. float linearAttenuation; // Specifies the linear light attenuation factor. float quadraticAttenuation; // Specifies the quadratic light attenuation factor. float range; // Specifies the maximum distance of the light influence float width; // Specifies the width of the area light surface. float height; // Specifies the height of the area light surface; vec4 shadowControls; mat4 shadowView; int shadowIdx; }; layout (std140) uniform cbBufferLights { int uNumLights; LightSource qLights[MAX_NUM_LIGHTS]; }; // end "funcsampleLightVars.glsllib" // begin "funclambertReflectionBSDF.glsllib" vec4 lambertReflectionBSDF( in vec3 N, in vec3 L, in vec3 lightDiffuse ) { float cosThetaI = max( 0.0, dot( N, L ) ); return vec4( cosThetaI * lightDiffuse, 1.0 ); } // end "funclambertReflectionBSDF.glsllib" in vec3 varWorldPos; in vec3 varViewVector; in vec3 varNormal; in vec2 diffuseMap_uv_coords; in vec2 varTexCoord0; uniform vec4 material_diffuse; uniform vec3 diffuse_color; uniform vec4 material_properties; uniform vec3 light_ambient_total; uniform sampler2D diffuseMap_sampler; uniform vec3 diffuseMap_offsets; uniform vec4 diffuseMap_rotations; void main() { float object_opacity = material_diffuse.a; vec3 uTransform; vec3 vTransform; vec3 view_vector = normalize(varViewVector); vec3 world_normal = normalize( varNormal ); vec3 vertColor = vec3(1.0); vec4 global_diffuse_light = vec4(light_ambient_total.xyz, 1.0); vec3 global_specular_light = vec3(0.0, 0.0, 0.0); float shadow_map_occl = 1.0; float lightAttenuation = 1.0; float aoFactor; aoFactor = 1.0; float shadowFac; vec3 specularColor = vec3(1.0); float roughnessAmount = material_properties.y; //Light light0 lightAttenuation = 1.0; shadowFac = 1.0; shadow_map_occl = 1.0; global_diffuse_light.rgb += shadowFac * shadow_map_occl * lambertReflectionBSDF( world_normal, -qLights[0].direction.xyz, qLights[0].diffuse.rgb ).rgb; global_diffuse_light = vec4(global_diffuse_light.xyz * aoFactor, object_opacity); global_specular_light = vec3(global_specular_light.xyz); global_diffuse_light.rgb *= diffuse_color.rgb; global_diffuse_light.rgb += diffuse_color.rgb * material_diffuse.rgb; vec4 texture_color; texture_color = texture2D( diffuseMap_sampler, diffuseMap_uv_coords); texture_color.rgb = texture_color.a > 0.0 ? texture_color.rgb / texture_color.a : vec3( 0, 0, 0 ); global_diffuse_light *= texture_color; fragOutput = vec4( clamp( vertColor * global_diffuse_light.xyz + global_specular_light.xyz, 0.0, 65519.0 ), global_diffuse_light.a ); } *** QOpenGLShader::compile(Vertex): ERROR: 0:1: '' : version '330' is not supported ERROR: 0:1: '' : syntax error: #version *** Problematic Vertex shader source code *** #version 330 core #define lowp #define mediump #define highp #line 1 in vec4 vertexPosition; in vec2 vertexTexCoord; out vec2 texCoord; uniform mat4 modelMatrix; void main() { texCoord = vertexTexCoord; gl_Position = modelMatrix * vertexPosition; } *** QOpenGLShader::compile(Fragment): ERROR: 0:1: '' : version '330' is not supported ERROR: 0:1: '' : syntax error: #version *** Problematic Fragment shader source code *** #version 330 core #ifdef GL_KHR_blend_equation_advanced #extension GL_ARB_fragment_coord_conventions : enable #extension GL_KHR_blend_equation_advanced : enable #endif #define lowp #define mediump #define highp #line 1 in vec2 texCoord; uniform sampler2D tex; out vec4 fragColor; void main() { vec4 c = texture(tex, texCoord); // This discard, while not necessarily ideal for some GPUs, is necessary to // get correct results with certain layer blend modes for example. if (c.a == 0.0) discard; fragColor = c; } *** QOpenGLShader::compile(Fragment): ERROR: 0:7: Invalid storage qualifiers 'in' in global variable context ERROR: 0:15: Use of undeclared identifier 'uv_coords' ERROR: 0:16: Use of undeclared identifier 'uv_coords' ERROR: 0:17: Use of undeclared identifier 'depth1' ERROR: 0:17: Use of undeclared identifier 'uv_coords' ERROR: 0:18: Use of undeclared identifier 'uv_coords' ERROR: 0:19: Use of undeclared identifier 'depth2' ERROR: 0:19: Use of undeclared identifier 'uv_coords' ERROR: 0:20: Use of undeclared identifier 'depth0' ERROR: 0:20: Use of undeclared identifier 'depth1' ERROR: 0:20: Use of undeclared identifier 'depth2' ERROR: 0:21: Use of undeclared identifier 'fragOutput' ERROR: 0:21: Use of undeclared identifier 'outDepth' *** Problematic Fragment shader source code *** #version 110 #ifdef GL_KHR_blend_equation_advanced #extension GL_ARB_fragment_coord_conventions : enable #extension GL_KHR_blend_equation_advanced : enable #endif #define lowp #define mediump #define highp #line 1 #define GLSL_100 1 #define GLSL_130 0 #define MAX_NUM_LIGHTS 16 #define MAX_AREA_LIGHTS 16 in vec2 uv_coords; uniform vec2 camera_properties; uniform sampler2D depthSrc; void main() { vec2 ofsScale = vec2( camera_properties.x / 7680.0, 0.0 ); float depth0 = texture(depthSrc, uv_coords).x; float depth1 = texture(depthSrc, uv_coords + ofsScale).x; depth1 += texture(depthSrc, uv_coords - ofsScale).x; float depth2 = texture(depthSrc, uv_coords + 2.0 * ofsScale).x; depth2 += texture(depthSrc, uv_coords - 2.0 * ofsScale).x; float outDepth = 0.38774 * depth0 + 0.24477 * depth1 + 0.06136 * depth2; fragOutput = vec4(outDepth); } *** QOpenGLShader::compile(Fragment): ERROR: 0:7: Invalid storage qualifiers 'in' in global variable context ERROR: 0:15: Use of undeclared identifier 'uv_coords' ERROR: 0:16: Use of undeclared identifier 'uv_coords' ERROR: 0:17: Use of undeclared identifier 'depth1' ERROR: 0:17: Use of undeclared identifier 'uv_coords' ERROR: 0:18: Use of undeclared identifier 'uv_coords' ERROR: 0:19: Use of undeclared identifier 'depth2' ERROR: 0:19: Use of undeclared identifier 'uv_coords' ERROR: 0:20: Use of undeclared identifier 'depth0' ERROR: 0:20: Use of undeclared identifier 'depth1' ERROR: 0:20: Use of undeclared identifier 'depth2' ERROR: 0:21: Use of undeclared identifier 'fragOutput' ERROR: 0:21: Use of undeclared identifier 'outDepth' *** Problematic Fragment shader source code *** #version 110 #ifdef GL_KHR_blend_equation_advanced #extension GL_ARB_fragment_coord_conventions : enable #extension GL_KHR_blend_equation_advanced : enable #endif #define lowp #define mediump #define highp #line 1 #define GLSL_100 1 #define GLSL_130 0 #define MAX_NUM_LIGHTS 16 #define MAX_AREA_LIGHTS 16 in vec2 uv_coords; uniform vec2 camera_properties; uniform sampler2D depthSrc; void main() { vec2 ofsScale = vec2( 0.0, camera_properties.x / 7680.0 ); float depth0 = texture(depthSrc, uv_coords).x; float depth1 = texture(depthSrc, uv_coords + ofsScale).x; depth1 += texture(depthSrc, uv_coords - ofsScale).x; float depth2 = texture(depthSrc, uv_coords + 2.0 * ofsScale).x; depth2 += texture(depthSrc, uv_coords - 2.0 * ofsScale).x; float outDepth = 0.38774 * depth0 + 0.24477 * depth1 + 0.06136 * depth2; fragOutput = vec4(outDepth); } *** QOpenGLShader::compile(Fragment): ERROR: 0:14: 'layout' : syntax error: syntax error *** Problematic Fragment shader source code *** #version 110 #ifdef GL_KHR_blend_equation_advanced #extension GL_ARB_fragment_coord_conventions : enable #extension GL_KHR_blend_equation_advanced : enable #endif #define lowp #define mediump #define highp #line 1 #define GLSL_100 1 #define GLSL_130 0 #define Q3DS_NO_FRAGOUTPUT 1 #define MAX_NUM_LIGHTS 16 #define MAX_AREA_LIGHTS 16 in vec2 uv_coords; uniform vec2 camera_properties; uniform samplerCube depthCube; layout(location = 0) out vec4 frag0; layout(location = 1) out vec4 frag1; layout(location = 2) out vec4 frag2; layout(location = 3) out vec4 frag3; layout(location = 4) out vec4 frag4; layout(location = 5) out vec4 frag5; void main() { float ofsScale = camera_properties.x / 2500.0; vec3 dir0 = vec3(1.0, -uv_coords.y, -uv_coords.x); vec3 dir1 = vec3(-1.0, -uv_coords.y, uv_coords.x); vec3 dir2 = vec3(uv_coords.x, 1.0, uv_coords.y); vec3 dir3 = vec3(uv_coords.x, -1.0, -uv_coords.y); vec3 dir4 = vec3(uv_coords.x, -uv_coords.y, 1.0); vec3 dir5 = vec3(-uv_coords.x, -uv_coords.y, -1.0); float depth0; float depth1; float depth2; float outDepth; depth0 = texture(depthCube, dir0).x; depth1 = texture(depthCube, dir0 + vec3(0.0, 0.0, -ofsScale)).x; depth1 += texture(depthCube, dir0 + vec3(0.0, 0.0, ofsScale)).x; depth2 = texture(depthCube, dir0 + vec3(0.0, 0.0, -2.0*ofsScale)).x; depth2 += texture(depthCube, dir0 + vec3(0.0, 0.0, 2.0*ofsScale)).x; outDepth = 0.38774 * depth0 + 0.24477 * depth1 + 0.06136 * depth2; frag0 = vec4(outDepth); depth0 = texture(depthCube, dir1).x; depth1 = texture(depthCube, dir1 + vec3(0.0, 0.0, -ofsScale)).x; depth1 += texture(depthCube, dir1 + vec3(0.0, 0.0, ofsScale)).x; depth2 = texture(depthCube, dir1 + vec3(0.0, 0.0, -2.0*ofsScale)).x; depth2 += texture(depthCube, dir1 + vec3(0.0, 0.0, 2.0*ofsScale)).x; outDepth = 0.38774 * depth0 + 0.24477 * depth1 + 0.06136 * depth2; frag1 = vec4(outDepth); depth0 = texture(depthCube, dir2).x; depth1 = texture(depthCube, dir2 + vec3(-ofsScale, 0.0, 0.0)).x; depth1 += texture(depthCube, dir2 + vec3(ofsScale, 0.0, 0.0)).x; depth2 = texture(depthCube, dir2 + vec3(-2.0*ofsScale, 0.0, 0.0)).x; depth2 += texture(depthCube, dir2 + vec3(2.0*ofsScale, 0.0, 0.0)).x; outDepth = 0.38774 * depth0 + 0.24477 * depth1 + 0.06136 * depth2; frag2 = vec4(outDepth); depth0 = texture(depthCube, dir3).x; depth1 = texture(depthCube, dir3 + vec3(-ofsScale, 0.0, 0.0)).x; depth1 += texture(depthCube, dir3 + vec3(ofsScale, 0.0, 0.0)).x; depth2 = texture(depthCube, dir3 + vec3(-2.0*ofsScale, 0.0, 0.0)).x; depth2 += texture(depthCube, dir3 + vec3(2.0*ofsScale, 0.0, 0.0)).x; outDepth = 0.38774 * depth0 + 0.24477 * depth1 + 0.06136 * depth2; frag3 = vec4(outDepth); depth0 = texture(depthCube, dir4).x; depth1 = texture(depthCube, dir4 + vec3(-ofsScale, 0.0, 0.0)).x; depth1 += texture(depthCube, dir4 + vec3(ofsScale, 0.0, 0.0)).x; depth2 = texture(depthCube, dir4 + vec3(-2.0*ofsScale, 0.0, 0.0)).x; depth2 += texture(depthCube, dir4 + vec3(2.0*ofsScale, 0.0, 0.0)).x; outDepth = 0.38774 * depth0 + 0.24477 * depth1 + 0.06136 * depth2; frag4 = vec4(outDepth); depth0 = texture(depthCube, dir5).x; depth1 = texture(depthCube, dir5 + vec3(-ofsScale, 0.0, 0.0)).x; depth1 += texture(depthCube, dir5 + vec3(ofsScale, 0.0, 0.0)).x; depth2 = texture(depthCube, dir5 + vec3(-2.0*ofsScale, 0.0, 0.0)).x; depth2 += texture(depthCube, dir5 + vec3(2.0*ofsScale, 0.0, 0.0)).x; outDepth = 0.38774 * depth0 + 0.24477 * depth1 + 0.06136 * depth2; frag5 = vec4(outDepth); } *** QOpenGLShader::compile(Fragment): ERROR: 0:14: 'layout' : syntax error: syntax error *** Problematic Fragment shader source code *** #version 110 #ifdef GL_KHR_blend_equation_advanced #extension GL_ARB_fragment_coord_conventions : enable #extension GL_KHR_blend_equation_advanced : enable #endif #define lowp #define mediump #define highp #line 1 #define GLSL_100 1 #define GLSL_130 0 #define Q3DS_NO_FRAGOUTPUT 1 #define MAX_NUM_LIGHTS 16 #define MAX_AREA_LIGHTS 16 in vec2 uv_coords; uniform vec2 camera_properties; uniform samplerCube depthCube; layout(location = 0) out vec4 frag0; layout(location = 1) out vec4 frag1; layout(location = 2) out vec4 frag2; layout(location = 3) out vec4 frag3; layout(location = 4) out vec4 frag4; layout(location = 5) out vec4 frag5; void main() { float ofsScale = camera_properties.x / 2500.0; vec3 dir0 = vec3(1.0, -uv_coords.y, -uv_coords.x); vec3 dir1 = vec3(-1.0, -uv_coords.y, uv_coords.x); vec3 dir2 = vec3(uv_coords.x, 1.0, uv_coords.y); vec3 dir3 = vec3(uv_coords.x, -1.0, -uv_coords.y); vec3 dir4 = vec3(uv_coords.x, -uv_coords.y, 1.0); vec3 dir5 = vec3(-uv_coords.x, -uv_coords.y, -1.0); float depth0; float depth1; float depth2; float outDepth; depth0 = texture(depthCube, dir0).x; depth1 = texture(depthCube, dir0 + vec3(0.0, -ofsScale, 0.0)).x; depth1 += texture(depthCube, dir0 + vec3(0.0, ofsScale, 0.0)).x; depth2 = texture(depthCube, dir0 + vec3(0.0, -2.0*ofsScale, 0.0)).x; depth2 += texture(depthCube, dir0 + vec3(0.0, 2.0*ofsScale, 0.0)).x; outDepth = 0.38774 * depth0 + 0.24477 * depth1 + 0.06136 * depth2; frag0 = vec4(outDepth); depth0 = texture(depthCube, dir1).x; depth1 = texture(depthCube, dir1 + vec3(0.0, -ofsScale, 0.0)).x; depth1 += texture(depthCube, dir1 + vec3(0.0, ofsScale, 0.0)).x; depth2 = texture(depthCube, dir1 + vec3(0.0, -2.0*ofsScale, 0.0)).x; depth2 += texture(depthCube, dir1 + vec3(0.0, 2.0*ofsScale, 0.0)).x; outDepth = 0.38774 * depth0 + 0.24477 * depth1 + 0.06136 * depth2; frag1 = vec4(outDepth); depth0 = texture(depthCube, dir2).x; depth1 = texture(depthCube, dir2 + vec3(0.0, 0.0, -ofsScale)).x; depth1 += texture(depthCube, dir2 + vec3(0.0, 0.0, ofsScale)).x; depth2 = texture(depthCube, dir2 + vec3(0.0, 0.0, -2.0*ofsScale)).x; depth2 += texture(depthCube, dir2 + vec3(0.0, 0.0, 2.0*ofsScale)).x; outDepth = 0.38774 * depth0 + 0.24477 * depth1 + 0.06136 * depth2; frag2 = vec4(outDepth); depth0 = texture(depthCube, dir3).x; depth1 = texture(depthCube, dir3 + vec3(0.0, 0.0, -ofsScale)).x; depth1 += texture(depthCube, dir3 + vec3(0.0, 0.0, ofsScale)).x; depth2 = texture(depthCube, dir3 + vec3(0.0, 0.0, -2.0*ofsScale)).x; depth2 += texture(depthCube, dir3 + vec3(0.0, 0.0, 2.0*ofsScale)).x; outDepth = 0.38774 * depth0 + 0.24477 * depth1 + 0.06136 * depth2; frag3 = vec4(outDepth); depth0 = texture(depthCube, dir4).x; depth1 = texture(depthCube, dir4 + vec3(0.0, -ofsScale, 0.0)).x; depth1 += texture(depthCube, dir4 + vec3(0.0, ofsScale, 0.0)).x; depth2 = texture(depthCube, dir4 + vec3(0.0, -2.0*ofsScale, 0.0)).x; depth2 += texture(depthCube, dir4 + vec3(0.0, 2.0*ofsScale, 0.0)).x; outDepth = 0.38774 * depth0 + 0.24477 * depth1 + 0.06136 * depth2; frag4 = vec4(outDepth); depth0 = texture(depthCube, dir5).x; depth1 = texture(depthCube, dir5 + vec3(0.0, -ofsScale, 0.0)).x; depth1 += texture(depthCube, dir5 + vec3(0.0, ofsScale, 0.0)).x; depth2 = texture(depthCube, dir5 + vec3(0.0, -2.0*ofsScale, 0.0)).x; depth2 += texture(depthCube, dir5 + vec3(0.0, 2.0*ofsScale, 0.0)).x; outDepth = 0.38774 * depth0 + 0.24477 * depth1 + 0.06136 * depth2; frag5 = vec4(outDepth); } *** QOpenGLShader::compile(Fragment): ERROR: 0:213: 'layout' : syntax error: syntax error *** Problematic Fragment shader source code *** #version 110 #ifdef GL_KHR_blend_equation_advanced #extension GL_ARB_fragment_coord_conventions : enable #extension GL_KHR_blend_equation_advanced : enable #endif #define lowp #define mediump #define highp #line 1 #define GLSL_100 1 #define GLSL_130 0 #define MAX_NUM_LIGHTS 16 #define MAX_AREA_LIGHTS 16 // begin "viewProperties.glsllib" #ifndef VIEW_PROPERTIES_GLSLLIB #define VIEW_PROPERTIES_GLSLLIB uniform mat4 viewProjectionMatrix; uniform mat4 viewMatrix; uniform vec2 camera_properties; //near clip x, far clip y #ifndef SSAO_CUSTOM_MATERIAL_GLSLLIB uniform vec3 eyePosition; //position in world space of the camera #endif #endif // end "viewProperties.glsllib" // begin "screenSpaceAO.glsllib" #ifndef SCREEN_SPACE_AO_GLSLLIB #define SCREEN_SPACE_AO_GLSLLIB 1 // begin "depthpass.glsllib" #ifndef DEPTHPASS_GLSLIB #define DEPTHPASS_GLSLIB 1 float calculateVertexDepth( vec2 camera_properties, vec4 position ) { float camera_range = camera_properties.y - camera_properties.x; return 1.0 - ((position.w - camera_properties.x) / (camera_range)); } #if __VERSION__ <= 120 float modf(in float val, out float integer) { integer = floor(val); return val - integer; } #endif vec4 outputDepth( float vert_depth ) { float integer_portion = 0.0; float fraction = modf((vert_depth * 255.0), integer_portion); return vec4( integer_portion / 255.0, fraction, 0, 1.0 ); } float getDepthValue( vec4 depth_texture_sample, vec2 camera_properties ) { #if __VERSION__ >= 300 float zNear = camera_properties.x; float zFar = camera_properties.y; float zRange = zFar - zNear; float z_b = depth_texture_sample.x; float z_n = 2.0 * z_b - 1.0; float z_e = 2.0 * zNear * zFar / (zFar + zNear - z_n * (zRange)); return 1.0 - ((z_e - camera_properties.x) / (zRange)); #else return depth_texture_sample.x + (depth_texture_sample.y / 255.0); #endif } float depthValueToLinearDistance( float depth_value, vec2 camera_properties ) { float FarClipDistance = camera_properties.y; float NearClipDistance = camera_properties.x; float DepthRange = FarClipDistance - NearClipDistance; float linearDepth = NearClipDistance + (DepthRange * (1.0 - depth_value)); return linearDepth; } #endif // end "depthpass.glsllib" float hashRot(vec2 pos) { // Basically an odd-even hash. float px = 2.0 * fract(floor(pos.x) * 0.5); float py = fract(floor(pos.y) * 0.5); return px + py; } vec3 quatRotate( vec4 q, vec3 v ) { return v + 2.0 * cross( cross( v, q.xyz ) + q.w * v, q.xyz ); } vec3 getViewSpacePos( sampler2D depthSampler, vec2 camProps, vec2 UV, vec4 UvToEye ) { float sampleDepth = getDepthValue( texture(depthSampler, UV), camProps ); sampleDepth = depthValueToLinearDistance( sampleDepth, camProps ); vec2 scaledUV = (UV * UvToEye.xy) + UvToEye.zw; return vec3(scaledUV * sampleDepth, sampleDepth); } vec2 computeDir( vec2 baseDir, int v ) { float ang = 3.1415926535 * hashRot( gl_FragCoord.xy ) + float(v - 1); vec2 vX = vec2(cos(ang), sin(ang)); vec2 vY = vec2(-sin(ang), cos(ang)); return vec2( dot(baseDir, vX), dot(baseDir, vY) ); } vec2 offsetDir( vec2 baseDir, int v ) { float ang = float(v - 1); vec2 vX = vec2(cos(ang), sin(ang)); vec2 vY = vec2(-sin(ang), cos(ang)); return vec2( dot(baseDir, vX), dot(baseDir, vY) ); } float SSambientOcclusion(sampler2D depthSampler, vec3 viewNorm, vec4 aoParams, vec4 aoParams2, vec2 camProps, vec4 aoScreen, vec4 UvToEye) { float ret = 0.0; vec2 centerUV = gl_FragCoord.xy * aoScreen.zw; vec3 viewPos = getViewSpacePos( depthSampler, camProps, centerUV, UvToEye ); viewPos += viewNorm * aoParams.w; float screenRadius = aoParams.y * aoScreen.y / viewPos.z; if (screenRadius < 1.0) { return 1.0; } vec3 kernel[9]; // The X and Y are the 2d direction, while the Z is the height of the sphere at that point. // In essence, it normalizes the 3d vector, but we're really interested in the 2D offset. kernel[0] = vec3(-0.1376476, 0.2842022, 0.948832); kernel[1] = vec3(-0.626618, 0.4594115, 0.629516); kernel[2] = vec3(-0.8903138, -0.05865424, 0.451554); kernel[3] = vec3(0.2871419, 0.8511679, 0.439389); kernel[4] = vec3(-0.1525251, -0.3870117, 0.909372); kernel[5] = vec3(0.6978705, -0.2176773, 0.682344); kernel[6] = vec3(0.7343006, 0.3774331, 0.5642); kernel[7] = vec3(0.1408805, -0.88915, 0.4353); kernel[8] = vec3(-0.6642616, -0.543601, 0.5130); int radLevels = int(floor(aoParams2.x)); float radStep = 1.0 / aoParams2.x; for (int j = 1; j <= radLevels; ++j) { for (int i = 0; i < 9; ++i) { float curRange = aoParams.y * radStep * float(j); float curRadius = curRange * kernel[i].z; vec3 smpDir; smpDir.xy = computeDir(kernel[i].xy, j) * aoParams2.y + (1.0 - aoParams2.y) * offsetDir(kernel[i].xy, j); smpDir.z = kernel[i].z; smpDir *= curRange; vec2 smpUV = centerUV.xy + smpDir.xy * aoScreen.zw; // First method is based on Horizon-Based AO vec3 samplePos = getViewSpacePos( depthSampler, camProps, smpUV, UvToEye ); vec3 smpVec = samplePos - viewPos; float lenRad = dot(smpVec, smpVec); smpVec = normalize(smpVec); float lenDot = dot(smpVec, viewNorm); lenRad /= aoParams.y*aoParams.y; float falloff = smoothstep(8.0, 0.0, (lenRad - 1.0) * 0.125); float occl = 1.0 - clamp(lenDot * falloff, 0.0, 1.0); ret += occl * occl; } } ret = (ret) / (9.0 * float(radLevels)); // Blend between soft and hard based on softness param // NOTE : the 0.72974 is actually an gamma-inverted 0.5 (assuming gamma 2.2) // Would not need this if we linearized color instead. float hardCut = (1.0 - aoParams.z) * 0.72974; ret = smoothstep(0.0, 1.0, (ret - hardCut) / (1.0 - hardCut)); // Blend between full and no occlusion based on strength param ret = aoParams.x * ret + (1.0 - aoParams.x); return ret; } #endif // end "screenSpaceAO.glsllib" in vec2 uv_coords; uniform sampler2D depth_sampler; layout (std140) uniform cbAoShadow { vec4 ao_properties; vec4 ao_properties2; vec4 shadow_properties; vec4 aoScreenConst; vec4 UvToEyeConst; }; void main() { float aoFactor; vec3 screenNorm; ivec2 iCoords = ivec2( gl_FragCoord.xy ); float depth = getDepthValue( texelFetch(depth_sampler, iCoords, 0), camera_properties ); depth = depthValueToLinearDistance( depth, camera_properties ); depth = (depth - camera_properties.x) / (camera_properties.y - camera_properties.x); float depth2 = getDepthValue( texelFetch(depth_sampler, iCoords+ivec2(1), 0), camera_properties ); depth2 = depthValueToLinearDistance( depth, camera_properties ); float depth3 = getDepthValue( texelFetch(depth_sampler, iCoords-ivec2(1), 0), camera_properties ); depth3 = depthValueToLinearDistance( depth, camera_properties ); vec3 tanU = vec3(10, 0, dFdx(depth)); vec3 tanV = vec3(0, 10, dFdy(depth)); screenNorm = normalize(cross(tanU, tanV)); tanU = vec3(10, 0, dFdx(depth2)); tanV = vec3(0, 10, dFdy(depth2)); screenNorm += normalize(cross(tanU, tanV)); tanU = vec3(10, 0, dFdx(depth3)); tanV = vec3(0, 10, dFdy(depth3)); screenNorm += normalize(cross(tanU, tanV)); screenNorm = -normalize(screenNorm); aoFactor = SSambientOcclusion( depth_sampler, screenNorm, ao_properties, ao_properties2, camera_properties, aoScreenConst, UvToEyeConst ); fragOutput = vec4(aoFactor, aoFactor, aoFactor, 1.0); } *** QOpenGLShader::compile(Fragment): ERROR: 0:7: Invalid storage qualifiers 'in' in global variable context ERROR: 0:15: Use of undeclared identifier 'uv_coords' ERROR: 0:16: Use of undeclared identifier 'uv_coords' ERROR: 0:17: Use of undeclared identifier 'fragOutput' ERROR: 0:17: Use of undeclared identifier 'accum' ERROR: 0:17: Use of undeclared identifier 'lastFrame' *** Problematic Fragment shader source code *** #version 110 #ifdef GL_KHR_blend_equation_advanced #extension GL_ARB_fragment_coord_conventions : enable #extension GL_KHR_blend_equation_advanced : enable #endif #define lowp #define mediump #define highp #line 1 #define GLSL_100 1 #define GLSL_130 0 #define MAX_NUM_LIGHTS 16 #define MAX_AREA_LIGHTS 16 in vec2 uv_coords; uniform sampler2D accumulator; uniform sampler2D last_frame; uniform vec2 blend_factors; void main() { vec4 accum = texture2D( accumulator, uv_coords ); vec4 lastFrame = texture2D( last_frame, uv_coords ); fragOutput = accum*blend_factors.y + lastFrame*blend_factors.x; } *** DepthStencil Attachment not supported on OpenGL 2.0