From 91a41b306e3f61deadfabee91f35c741e2e319d1 Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Tue, 2 Dec 2025 15:23:08 +0100 Subject: [PATCH 01/10] Don't set pps_range_extension_flag --- server/encoder/video_encoder_vulkan_h265.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/encoder/video_encoder_vulkan_h265.cpp b/server/encoder/video_encoder_vulkan_h265.cpp index f9d51d1c..9030e974 100644 --- a/server/encoder/video_encoder_vulkan_h265.cpp +++ b/server/encoder/video_encoder_vulkan_h265.cpp @@ -166,7 +166,7 @@ wivrn::video_encoder_vulkan_h265::video_encoder_vulkan_h265( .cu_qp_delta_enabled_flag = 1, // must be 1 or nvidia breaks .transquant_bypass_enabled_flag = 0, // only 1 when tuned for lossless .deblocking_filter_control_present_flag = 1, - .pps_range_extension_flag = (settings.bit_depth == 10) ? 1u : 0u, + .pps_range_extension_flag = 0u, }, .pps_pic_parameter_set_id = 0, From ab82fb58669e4484f22e6ef4a6436e172b30e2ba Mon Sep 17 00:00:00 2001 From: Guillaume Meunier Date: Sun, 30 Nov 2025 18:33:36 +0100 Subject: [PATCH 02/10] Add proper support for 8 bit indices --- client/application.cpp | 34 ++++++++++++++++++++------------ client/render/gpu_buffer.h | 27 +++++++++++++++++++------ client/render/scene_loader.cpp | 30 ++++------------------------ client/utils/class_from_member.h | 32 ++++++++++++++++++++++++++++++ 4 files changed, 78 insertions(+), 45 deletions(-) create mode 100644 client/utils/class_from_member.h diff --git a/client/application.cpp b/client/application.cpp index 9adbb0d4..77cc1014 100644 --- a/client/application.cpp +++ b/client/application.cpp @@ -24,6 +24,7 @@ #include "scene.h" #include "spdlog/common.h" #include "spdlog/spdlog.h" +#include "utils/class_from_member.h" #include "utils/contains.h" #include "utils/files.h" #include "utils/i18n.h" @@ -761,6 +762,7 @@ void application::initialize_vulkan() vk_device_extensions.push_back(VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME); vk_device_extensions.push_back(VK_KHR_SAMPLER_YCBCR_CONVERSION_EXTENSION_NAME); vk_device_extensions.push_back(VK_KHR_MULTIVIEW_EXTENSION_NAME); + optional_device_extensions.emplace(VK_EXT_INDEX_TYPE_UINT8_EXTENSION_NAME); optional_device_extensions.emplace(VK_IMG_FILTER_CUBIC_EXTENSION_NAME); optional_device_extensions.emplace(VK_KHR_TIMELINE_SEMAPHORE_EXTENSION_NAME); optional_device_extensions.emplace(VK_EXT_FRAGMENT_DENSITY_MAP_EXTENSION_NAME); @@ -884,24 +886,30 @@ void application::initialize_vulkan() vk::PhysicalDeviceSamplerYcbcrConversionFeaturesKHR{ .samplerYcbcrConversion = true, }, - vk::PhysicalDeviceTimelineSemaphoreFeaturesKHR{ - .timelineSemaphore = true, - }, + vk::PhysicalDeviceTimelineSemaphoreFeaturesKHR{}, vk::PhysicalDeviceMultiviewFeaturesKHR{ .multiview = true, }, + vk::PhysicalDeviceIndexTypeUint8FeaturesEXT{}}; + + auto check_feature_flag = [&](auto feature_flag, const char * extension_name) -> bool { + using FeatureStruct = class_from_member_t; + + if (utils::contains(vk_device_extensions, extension_name) and + vk_physical_device.getFeatures2().template get().*feature_flag) + { + device_create_info.get().*feature_flag = true; + return true; + } + else + { + device_create_info.unlink(); + return false; + } }; - if (utils::contains(vk_device_extensions, VK_KHR_TIMELINE_SEMAPHORE_EXTENSION_NAME)) - { - auto [_, feat] = vk_physical_device.getFeatures2(); - auto & create_feat = device_create_info.get(); - create_feat.timelineSemaphore = feat.timelineSemaphore; - } - else - { - device_create_info.unlink(); - } + check_feature_flag(&vk::PhysicalDeviceTimelineSemaphoreFeaturesKHR::timelineSemaphore, VK_KHR_TIMELINE_SEMAPHORE_EXTENSION_NAME); + check_feature_flag(&vk::PhysicalDeviceIndexTypeUint8FeaturesEXT::indexTypeUint8, VK_EXT_INDEX_TYPE_UINT8_EXTENSION_NAME); vk_device = xr_system_id.create_device(vk_physical_device, device_create_info.get()); *vk_queue.lock() = vk_device.getQueue(vk_queue_family_index, 0); diff --git a/client/render/gpu_buffer.h b/client/render/gpu_buffer.h index 892dc3fb..d1c06d9a 100644 --- a/client/render/gpu_buffer.h +++ b/client/render/gpu_buffer.h @@ -18,7 +18,9 @@ #pragma once +#include "application.h" #include "utils/alignment.h" +#include "utils/contains.h" #include "vk/allocation.h" #include #include @@ -29,6 +31,8 @@ class gpu_buffer { std::vector bytes; vk::PhysicalDeviceLimits limits; + vk::PhysicalDeviceIndexTypeUint8FeaturesEXT feat_uint8; + fastgltf::Asset & asset; vk::BufferUsageFlags usage; @@ -58,8 +62,15 @@ class gpu_buffer } public: - gpu_buffer(vk::PhysicalDeviceProperties properties, fastgltf::Asset & asset) : - limits(properties.limits), asset(asset), usage(0) {} + gpu_buffer(vk::raii::PhysicalDevice physical_device, fastgltf::Asset & asset) : + asset(asset), + usage(0) + { + limits = physical_device.getProperties().limits; + + if (utils::contains(application::instance().get_vk_device_extensions(), VK_EXT_INDEX_TYPE_UINT8_EXTENSION_NAME)) + std::tie(std::ignore, feat_uint8) = physical_device.getFeatures2(); + } template size_t add_uniform(const T & data_to_add) @@ -79,7 +90,7 @@ public: return add(alignment, data_to_add); } - size_t add_indices(const fastgltf::Accessor & accessor) + std::pair add_indices(const fastgltf::Accessor & accessor) { usage |= vk::BufferUsageFlagBits::eIndexBuffer; @@ -90,7 +101,11 @@ public: std::vector indices(accessor.count); using index_t = std::remove_cvref_t; fastgltf::copyFromAccessor(asset, accessor, indices.data()); - return add(4, indices); + + if (feat_uint8.indexTypeUint8) + return {add(4, indices), vk::IndexType::eUint8EXT}; + else + return {add(4, std::vector{indices.begin(), indices.end()}), vk::IndexType::eUint16}; } case fastgltf::ComponentType::Short: @@ -98,7 +113,7 @@ public: std::vector indices(accessor.count); using index_t = std::remove_cvref_t; fastgltf::copyFromAccessor(asset, accessor, indices.data()); - return add(4, indices); + return {add(4, indices), vk::IndexType::eUint16}; } case fastgltf::ComponentType::Int: @@ -106,7 +121,7 @@ public: std::vector indices(accessor.count); using index_t = std::remove_cvref_t; fastgltf::copyFromAccessor(asset, accessor, indices.data()); - return add(4, indices); + return {add(4, indices), vk::IndexType::eUint32}; } default: diff --git a/client/render/scene_loader.cpp b/client/render/scene_loader.cpp index 60b3d739..b22b7bfa 100644 --- a/client/render/scene_loader.cpp +++ b/client/render/scene_loader.cpp @@ -18,10 +18,12 @@ #include "scene_loader.h" +#include "application.h" #include "gpu_buffer.h" #include "image_loader.h" #include "render/scene_components.h" #include "render/vertex_layout.h" +#include "utils/contains.h" #include "utils/files.h" #include "utils/json_string.h" #include "utils/mapped_file.h" @@ -808,30 +810,8 @@ public: fastgltf::Accessor & indices_accessor = gltf.accessors.at(*gltf_primitive.indicesAccessor); primitive_ref.indexed = true; - primitive_ref.index_offset = staging_buffer.add_indices(indices_accessor); + std::tie(primitive_ref.index_offset, primitive_ref.index_type) = staging_buffer.add_indices(indices_accessor); primitive_ref.index_count = indices_accessor.count; - - switch (indices_accessor.componentType) - { - case fastgltf::ComponentType::Byte: - case fastgltf::ComponentType::UnsignedByte: - primitive_ref.index_type = vk::IndexType::eUint8EXT; - break; - - case fastgltf::ComponentType::Short: - case fastgltf::ComponentType::UnsignedShort: - primitive_ref.index_type = vk::IndexType::eUint16; - break; - - case fastgltf::ComponentType::Int: - case fastgltf::ComponentType::UnsignedInt: - primitive_ref.index_type = vk::IndexType::eUint32; - break; - - default: - throw std::runtime_error("Invalid index type"); - break; - } } else primitive_ref.indexed = false; @@ -1089,8 +1069,6 @@ std::shared_ptr scene_loader::operator()( const std::filesystem::path & gltf_texture_cache, std::function progress_cb) { - vk::PhysicalDeviceProperties physical_device_properties = physical_device.getProperties(); - auto data_buffer = fastgltf::GltfDataBuffer::FromBytes(data.data(), data.size()); if (auto error = data_buffer.error(); error != fastgltf::Error::None) throw std::system_error((int)error, fastgltf_error_category); @@ -1108,7 +1086,7 @@ std::shared_ptr scene_loader::operator()( // Load all buffers from URIs ctx.load_all_buffers(); - gpu_buffer staging_buffer(physical_device_properties, asset); + gpu_buffer staging_buffer(physical_device, asset); // Load all textures auto textures = ctx.load_all_textures(gltf_texture_cache, progress_cb); diff --git a/client/utils/class_from_member.h b/client/utils/class_from_member.h new file mode 100644 index 00000000..95f6321f --- /dev/null +++ b/client/utils/class_from_member.h @@ -0,0 +1,32 @@ +/* + * WiVRn VR streaming + * Copyright (C) 2025 Guillaume Meunier + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once +template +struct class_from_member +{ +}; + +template +struct class_from_member +{ + using type = U; +}; + +template +using class_from_member_t = class_from_member::type; From f99fb8fa1856af285ffe1f4d1b89243d66708d75 Mon Sep 17 00:00:00 2001 From: Guillaume Meunier Date: Sun, 30 Nov 2025 18:51:43 +0100 Subject: [PATCH 03/10] Add support for KHR_texture_transform --- client/render/scene_components.h | 20 ++++++---- client/render/scene_loader.cpp | 57 ++++++++++++++++------------ client/render/scene_renderer.cpp | 2 +- client/shaders/common.glsl.inc | 41 +++++++++++++++++--- client/shaders/lit.vert.glsl | 13 ++++--- client/shaders/lit_skinned.vert.glsl | 8 ++-- 6 files changed, 92 insertions(+), 49 deletions(-) diff --git a/client/render/scene_components.h b/client/render/scene_components.h index ca3bcad3..28b1b2a9 100644 --- a/client/render/scene_components.h +++ b/client/render/scene_components.h @@ -55,6 +55,14 @@ struct texture struct material { + struct alignas(16) texture_info + { + alignas(4) uint32_t texcoord = 0; + alignas(4) float rotation = 0; + alignas(8) glm::vec2 offset = {0, 0}; + alignas(8) glm::vec2 scale = {1, 1}; + }; + struct gpu_data { glm::vec4 base_color_factor = glm::vec4(1, 1, 1, 1); @@ -65,13 +73,11 @@ struct material float normal_scale = 1; float alpha_cutoff = 0.5; - uint32_t base_color_texcoord = 0; - uint32_t metallic_roughness_texcoord = 0; - uint32_t occlusion_texcoord = 0; - uint32_t emissive_texcoord = 0; - uint32_t normal_texcoord = 0; - - // TODO: add fastgltf::TextureTransform? + texture_info base_color; + texture_info metallic_roughness; + texture_info occlusion; + texture_info emissive; + texture_info normal; }; std::shared_ptr base_color_texture; diff --git a/client/render/scene_loader.cpp b/client/render/scene_loader.cpp index b22b7bfa..5d8a4c22 100644 --- a/client/render/scene_loader.cpp +++ b/client/render/scene_loader.cpp @@ -168,6 +168,11 @@ glm::vec3 convert(const fastgltf::math::nvec3 & v) return {v[0], v[1], v[2]}; } +glm::vec2 convert(const fastgltf::math::nvec2 & v) +{ + return {v[0], v[1]}; +} + components::animation_track_base::interpolation_t convert(fastgltf::AnimationInterpolation interpolation) { switch (interpolation) @@ -443,7 +448,9 @@ struct : std::error_category fastgltf::Asset load_gltf_asset(fastgltf::GltfDataBuffer & buffer, const std::filesystem::path & directory) { - fastgltf::Parser parser(fastgltf::Extensions::KHR_texture_basisu); + fastgltf::Parser parser( + fastgltf::Extensions::KHR_texture_basisu | + fastgltf::Extensions::KHR_texture_transform); auto gltf_options = fastgltf::Options::DontRequireValidAssetMember | @@ -752,37 +759,37 @@ public: material_data.roughness_factor = gltf_material.pbrData.roughnessFactor; material_data.alpha_cutoff = gltf_material.alphaCutoff; - if (gltf_material.pbrData.baseColorTexture) - { - material.base_color_texture = textures.at(gltf_material.pbrData.baseColorTexture->textureIndex); - material_data.base_color_texcoord = gltf_material.pbrData.baseColorTexture->texCoordIndex; - } + auto f = [&](const auto & texture_info, + std::shared_ptr & texture, + renderer::material::texture_info & info) { + if (not texture_info) + return; - if (gltf_material.pbrData.metallicRoughnessTexture) - { - material.metallic_roughness_texture = textures.at(gltf_material.pbrData.metallicRoughnessTexture->textureIndex); - material_data.metallic_roughness_texcoord = gltf_material.pbrData.metallicRoughnessTexture->texCoordIndex; - } + texture = textures.at(texture_info->textureIndex); + info.texcoord = texture_info->texCoordIndex; + + if (auto & xform = texture_info->transform) + { + if (xform->texCoordIndex) + info.texcoord = *xform->texCoordIndex; + + info.rotation = xform->rotation; + info.offset = convert(xform->uvOffset); + info.scale = convert(xform->uvScale); + } + }; + + f(gltf_material.pbrData.baseColorTexture, material.base_color_texture, material_data.base_color); + f(gltf_material.pbrData.metallicRoughnessTexture, material.metallic_roughness_texture, material_data.metallic_roughness); + f(gltf_material.occlusionTexture, material.occlusion_texture, material_data.occlusion); + f(gltf_material.emissiveTexture, material.emissive_texture, material_data.emissive); + f(gltf_material.normalTexture, material.normal_texture, material_data.normal); if (gltf_material.occlusionTexture) - { - material.occlusion_texture = textures.at(gltf_material.occlusionTexture->textureIndex); - material_data.occlusion_texcoord = gltf_material.occlusionTexture->texCoordIndex; material_data.occlusion_strength = gltf_material.occlusionTexture->strength; - } - - if (gltf_material.emissiveTexture) - { - material.emissive_texture = textures.at(gltf_material.emissiveTexture->textureIndex); - material_data.emissive_texcoord = gltf_material.emissiveTexture->texCoordIndex; - } if (gltf_material.normalTexture) - { - material.normal_texture = textures.at(gltf_material.normalTexture->textureIndex); - material_data.normal_texcoord = gltf_material.normalTexture->texCoordIndex; material_data.normal_scale = gltf_material.normalTexture->scale; - } material.offset = staging_buffer.add_uniform(material_data); } diff --git a/client/render/scene_renderer.cpp b/client/render/scene_renderer.cpp index 7372f5fa..4b73386d 100644 --- a/client/render/scene_renderer.cpp +++ b/client/render/scene_renderer.cpp @@ -261,7 +261,7 @@ static std::array layout_bindings_0{ .binding = 8, .descriptorType = vk::DescriptorType::eUniformBuffer, .descriptorCount = 1, - .stageFlags = vk::ShaderStageFlagBits::eFragment, + .stageFlags = vk::ShaderStageFlagBits::eVertex | vk::ShaderStageFlagBits::eFragment, }, }; diff --git a/client/shaders/common.glsl.inc b/client/shaders/common.glsl.inc index d385dce8..ea0c249a 100644 --- a/client/shaders/common.glsl.inc +++ b/client/shaders/common.glsl.inc @@ -33,7 +33,16 @@ layout(set = 0, binding = 4) uniform sampler2D metallic_roughness_texture; layout(set = 0, binding = 5) uniform sampler2D occlusion_texture; layout(set = 0, binding = 6) uniform sampler2D emissive_texture; layout(set = 0, binding = 7) uniform sampler2D normal_map_texture; -layout(set = 0, binding = 8) uniform material_ubo + +struct texture_info +{ + int texcoord; + float rotation; + vec2 offset; + vec2 scale; +}; + +layout(std140, set = 0, binding = 8) uniform material_ubo { vec4 base_color_factor; vec4 base_emissive_factor; @@ -43,11 +52,11 @@ layout(set = 0, binding = 8) uniform material_ubo float normal_scale; float alpha_cutoff; - int base_color_texcoord; - int metallic_roughness_texcoord; - int occlusion_texcoord; - int emissive_texcoord; - int normal_texcoord; + texture_info base_color; + texture_info metallic_roughness; + texture_info occlusion; + texture_info emissive; + texture_info normal; } material; const float dither_pattern[4][4] = { @@ -91,6 +100,26 @@ vec4 dither(ivec2 frag_coord, vec4 colour) return colour + one_over_d_linear_to_srgb(colour) * vec4(dither_thd, dither_thd, dither_thd, 0) / 255.0f; } +vec2 compute_texcoord(texture_info info, vec2 in_texcoord) +{ + mat3 translation = mat3( + 1, 0, 0, + 0, 1, 0, + info.offset.x, info.offset.y, 1); + mat3 rotation = mat3( + cos(info.rotation), sin(info.rotation), 0, + -sin(info.rotation), cos(info.rotation), 0, + 0, 0, 1); + mat3 scale = mat3( + info.scale.x, 0, 0, + 0, info.scale.y, 0, + 0, 0, 1); + + mat3 matrix = translation * rotation * scale; + + return (matrix * vec3(in_texcoord, 1)).xy; +} + #ifdef FRAG_SHADER #define VS_TO_FS in #else diff --git a/client/shaders/lit.vert.glsl b/client/shaders/lit.vert.glsl index bacbebaa..a0b9e8df 100644 --- a/client/shaders/lit.vert.glsl +++ b/client/shaders/lit.vert.glsl @@ -34,14 +34,15 @@ layout(location = 5) in vec4 in_color; out gl_PerVertex { vec4 gl_Position; - float gl_ClipDistance[nb_clipping]; + float gl_ClipDistance[nb_clipping]; }; void main() { - // TODO: use base_color_texcoord et al instead of always using texcoord 0 - for (int i = 0; i < nb_texcoords; i++) - texcoord[i] = in_texcoord[i]; + // TODO use base_color_texcoord et al instead of always using texcoord 0 + // TODO use the correct transform + texcoord[0] = compute_texcoord(material.base_color, in_texcoord[material.base_color.texcoord]); + // TODO on CPU? mat3 mv = inverse(transpose(mat3(mesh.modelview[gl_ViewIndex]))); @@ -57,8 +58,8 @@ void main() frag_pos = mesh.modelview[gl_ViewIndex] * vec4(in_position, 1.0); light_pos = scene.view[gl_ViewIndex] * scene.light_position; - for(int i = 0; i < nb_clipping; i++) + for (int i = 0; i < nb_clipping; i++) { - gl_ClipDistance[i] = dot(mesh.clipping_plane[i], mesh.model * vec4(in_position, 1.0)); + gl_ClipDistance[i] = dot(mesh.clipping_plane[i], mesh.model * vec4(in_position, 1.0)); } } diff --git a/client/shaders/lit_skinned.vert.glsl b/client/shaders/lit_skinned.vert.glsl index 8d87c566..4be67996 100644 --- a/client/shaders/lit_skinned.vert.glsl +++ b/client/shaders/lit_skinned.vert.glsl @@ -36,14 +36,14 @@ layout(location = 7) in vec4 in_weights; out gl_PerVertex { vec4 gl_Position; - float gl_ClipDistance[nb_clipping]; + float gl_ClipDistance[nb_clipping]; }; void main() { - // TODO: use base_color_texcoord et al instead of always using texcoord 0 - for (int i = 0; i < nb_texcoords; i++) - texcoord[i] = in_texcoord[i]; + // TODO use base_color_texcoord et al instead of always using texcoord 0 + // TODO use the correct transform + texcoord[0] = compute_texcoord(material.base_color, in_texcoord[material.base_color.texcoord]); mat4 skinMatrix = in_weights.x * joints.joint_matrices[int(in_joints.x)] + From 6f50ba39794fe6fbd8c175caed055359d6d7851f Mon Sep 17 00:00:00 2001 From: Guillaume Meunier Date: Sun, 30 Nov 2025 19:43:47 +0100 Subject: [PATCH 04/10] Use the correct texcoord --- client/shaders/common.glsl.inc | 6 +++++- client/shaders/lit.frag.glsl | 10 +++++----- client/shaders/lit.vert.glsl | 9 +++++---- client/shaders/lit_mask.frag.glsl | 14 +++++++------- client/shaders/lit_skinned.vert.glsl | 8 +++++--- 5 files changed, 27 insertions(+), 20 deletions(-) diff --git a/client/shaders/common.glsl.inc b/client/shaders/common.glsl.inc index ea0c249a..b19183fd 100644 --- a/client/shaders/common.glsl.inc +++ b/client/shaders/common.glsl.inc @@ -131,4 +131,8 @@ layout(location = 0) VS_TO_FS vec3 normal; layout(location = 1) VS_TO_FS vec4 tangent; layout(location = 2) VS_TO_FS vec4 frag_pos; layout(location = 3) VS_TO_FS vec4 light_pos; -layout(location = 4) VS_TO_FS vec2 texcoord[nb_texcoords]; +layout(location = 4) VS_TO_FS vec2 texcoord_base_color; +layout(location = 5) VS_TO_FS vec2 texcoord_metallic_roughness; +layout(location = 6) VS_TO_FS vec2 texcoord_occlusion; +layout(location = 7) VS_TO_FS vec2 texcoord_emissive; +layout(location = 8) VS_TO_FS vec2 texcoord_normal; diff --git a/client/shaders/lit.frag.glsl b/client/shaders/lit.frag.glsl index 06f48228..8e7b5811 100644 --- a/client/shaders/lit.frag.glsl +++ b/client/shaders/lit.frag.glsl @@ -30,14 +30,14 @@ layout(early_fragment_tests) in; void main() { - vec4 albedo = material.base_color_factor * texture(base_color_texture, texcoord[0]); - vec3 emissive_color = (material.base_emissive_factor * texture(emissive_texture, texcoord[0])).rgb; + vec4 albedo = material.base_color_factor * texture(base_color_texture, texcoord_base_color); + vec3 emissive_color = (material.base_emissive_factor * texture(emissive_texture, texcoord_emissive)).rgb; vec3 normal_unit; if (use_normal_maps) { - vec3 sampled_normal = normalize(vec3(material.normal_scale, material.normal_scale, 1) * (texture(normal_map_texture, texcoord[0]).xyz * 2 - 1)); + vec3 sampled_normal = normalize(vec3(material.normal_scale, material.normal_scale, 1) * (texture(normal_map_texture, texcoord_normal).xyz * 2 - 1)); // glTF spec §3.7.2.1 vec3 bitangent = cross(normal, tangent.xyz) * tangent.w; @@ -54,8 +54,8 @@ void main() if (use_pbr) { - float ao = 1 + material.occlusion_strength * (texture(occlusion_texture, texcoord[0]).r - 1); - vec4 mr = texture(metallic_roughness_texture, texcoord[0]); + float ao = 1 + material.occlusion_strength * (texture(occlusion_texture, texcoord_occlusion).r - 1); + vec4 mr = texture(metallic_roughness_texture, texcoord_metallic_roughness); vec3 half_vec = normalize(light_dir + view_dir); diff --git a/client/shaders/lit.vert.glsl b/client/shaders/lit.vert.glsl index a0b9e8df..a612d7c9 100644 --- a/client/shaders/lit.vert.glsl +++ b/client/shaders/lit.vert.glsl @@ -39,10 +39,11 @@ out gl_PerVertex void main() { - // TODO use base_color_texcoord et al instead of always using texcoord 0 - // TODO use the correct transform - texcoord[0] = compute_texcoord(material.base_color, in_texcoord[material.base_color.texcoord]); - + texcoord_base_color = compute_texcoord(material.base_color, in_texcoord[material.base_color.texcoord]); + texcoord_metallic_roughness = compute_texcoord(material.metallic_roughness, in_texcoord[material.metallic_roughness.texcoord]); + texcoord_occlusion = compute_texcoord(material.occlusion, in_texcoord[material.occlusion.texcoord]); + texcoord_emissive = compute_texcoord(material.emissive, in_texcoord[material.emissive.texcoord]); + texcoord_normal = compute_texcoord(material.normal, in_texcoord[material.normal.texcoord]); // TODO on CPU? mat3 mv = inverse(transpose(mat3(mesh.modelview[gl_ViewIndex]))); diff --git a/client/shaders/lit_mask.frag.glsl b/client/shaders/lit_mask.frag.glsl index 3f2217b0..a802bee3 100644 --- a/client/shaders/lit_mask.frag.glsl +++ b/client/shaders/lit_mask.frag.glsl @@ -30,14 +30,14 @@ layout(location = 0) out vec4 out_color; void main() { - vec4 albedo = material.base_color_factor * texture(base_color_texture, texcoord[0]); - vec3 emissive_color = (material.base_emissive_factor * texture(emissive_texture, texcoord[0])).rgb; + vec4 albedo = material.base_color_factor * texture(base_color_texture, texcoord_base_color); + vec3 emissive_color = (material.base_emissive_factor * texture(emissive_texture, texcoord_emissive)).rgb; vec3 normal_unit; if (use_normal_maps) { - vec3 sampled_normal = normalize(vec3(material.normal_scale, material.normal_scale, 1) * (texture(normal_map_texture, texcoord[0]).xyz * 2 - 1)); + vec3 sampled_normal = normalize(vec3(material.normal_scale, material.normal_scale, 1) * (texture(normal_map_texture, texcoord_normal).xyz * 2 - 1)); // glTF spec §3.7.2.1 vec3 bitangent = cross(normal, tangent.xyz) * tangent.w; @@ -54,8 +54,8 @@ void main() if (use_pbr) { - float ao = 1 + material.occlusion_strength * (texture(occlusion_texture, texcoord[0]).r - 1); - vec4 mr = texture(metallic_roughness_texture, texcoord[0]); + float ao = 1 + material.occlusion_strength * (texture(occlusion_texture, texcoord_occlusion).r - 1); + vec4 mr = texture(metallic_roughness_texture, texcoord_metallic_roughness); vec3 half_vec = normalize(light_dir + view_dir); @@ -65,8 +65,8 @@ void main() vec3 light_colour = scene.light_color.rgb; float attenuation = 1; vec3 radiance = - per_light_radiance(albedo.rgb, metallic, roughness, light_colour, light_dir, normal_unit, view_dir, half_vec, attenuation) + - vec3(scene.ambient_color) * albedo.rgb * ao; + per_light_radiance(albedo.rgb, metallic, roughness, light_colour, light_dir, normal_unit, view_dir, half_vec, attenuation) + + vec3(scene.ambient_color) * albedo.rgb * ao; vec3 tmp = radiance + emissive_color; diff --git a/client/shaders/lit_skinned.vert.glsl b/client/shaders/lit_skinned.vert.glsl index 4be67996..5c8e7261 100644 --- a/client/shaders/lit_skinned.vert.glsl +++ b/client/shaders/lit_skinned.vert.glsl @@ -41,9 +41,11 @@ out gl_PerVertex void main() { - // TODO use base_color_texcoord et al instead of always using texcoord 0 - // TODO use the correct transform - texcoord[0] = compute_texcoord(material.base_color, in_texcoord[material.base_color.texcoord]); + texcoord_base_color = compute_texcoord(material.base_color, in_texcoord[material.base_color.texcoord]); + texcoord_metallic_roughness = compute_texcoord(material.metallic_roughness, in_texcoord[material.metallic_roughness.texcoord]); + texcoord_occlusion = compute_texcoord(material.occlusion, in_texcoord[material.occlusion.texcoord]); + texcoord_emissive = compute_texcoord(material.emissive, in_texcoord[material.emissive.texcoord]); + texcoord_normal = compute_texcoord(material.normal, in_texcoord[material.normal.texcoord]); mat4 skinMatrix = in_weights.x * joints.joint_matrices[int(in_joints.x)] + From 6317d77dba6b4cf7c40780ef370212f9e90d6b18 Mon Sep 17 00:00:00 2001 From: Guillaume Meunier Date: Mon, 1 Dec 2025 17:17:10 +0100 Subject: [PATCH 05/10] Remove unused includes --- client/render/image_loader.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/client/render/image_loader.cpp b/client/render/image_loader.cpp index 004a5789..f24a9706 100644 --- a/client/render/image_loader.cpp +++ b/client/render/image_loader.cpp @@ -23,13 +23,11 @@ #include "utils/thread_safe.h" #include "vk/allocation.h" #include "vk/vk_allocator.h" -#include #include #include #include #include #include -#include #include #include #include From 3afed5549e45083635cf49dc28ab46b3d9bd0f54 Mon Sep 17 00:00:00 2001 From: Guillaume Meunier Date: Mon, 1 Dec 2025 17:17:36 +0100 Subject: [PATCH 06/10] Remove unused argument --- client/render/scene_renderer.cpp | 4 ++-- client/render/scene_renderer.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/render/scene_renderer.cpp b/client/render/scene_renderer.cpp index 4b73386d..6b24dab1 100644 --- a/client/render/scene_renderer.cpp +++ b/client/render/scene_renderer.cpp @@ -138,7 +138,7 @@ std::shared_ptr scene_renderer::create_default_texture(image_ return std::make_shared(image_view, renderer::sampler_info{}); } -std::shared_ptr scene_renderer::create_default_material(vk::raii::CommandPool & cb_pool) +std::shared_ptr scene_renderer::create_default_material() { image_loader loader(device, physical_device, queue, queue_family_index); @@ -285,7 +285,7 @@ scene_renderer::scene_renderer( layout_0(create_descriptor_set_layout(layout_bindings_0, vk::DescriptorSetLayoutCreateFlagBits::ePushDescriptorKHR)) { // Create the default material - default_material = create_default_material(cb_pool); + default_material = create_default_material(); // Create Vulkan resources frame_resources.resize(frames_in_flight); diff --git a/client/render/scene_renderer.h b/client/render/scene_renderer.h index 707e1062..1b9f2561 100644 --- a/client/render/scene_renderer.h +++ b/client/render/scene_renderer.h @@ -148,7 +148,7 @@ class scene_renderer vk::raii::Pipeline create_pipeline(const pipeline_info & info); std::shared_ptr create_default_texture(image_loader & loader, std::vector pixel, const std::string & name); - std::shared_ptr create_default_material(vk::raii::CommandPool & cb_pool); + std::shared_ptr create_default_material(); vk::raii::DescriptorSetLayout create_descriptor_set_layout(std::span bindings, vk::DescriptorSetLayoutCreateFlags flags = {}); // Caches From e51d653bd76445a3f99dbb4a929dd79659fa1b0b Mon Sep 17 00:00:00 2001 From: Guillaume Meunier Date: Mon, 1 Dec 2025 17:19:30 +0100 Subject: [PATCH 07/10] Add the picked glTF model to the model list, create a screenshot --- client/render/image_writer.cpp | 116 +++++++++++++++++++++++++ client/render/image_writer.h | 42 +++++++++ client/scenes/lobby_gui_customize.cpp | 119 +++++++++++++++++++++++--- common/vk/allocation.h | 10 +++ 4 files changed, 275 insertions(+), 12 deletions(-) create mode 100644 client/render/image_writer.cpp create mode 100644 client/render/image_writer.h diff --git a/client/render/image_writer.cpp b/client/render/image_writer.cpp new file mode 100644 index 00000000..1c33248a --- /dev/null +++ b/client/render/image_writer.cpp @@ -0,0 +1,116 @@ +/* + * WiVRn VR streaming + * Copyright (C) 2025 Guillaume Meunier + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "image_writer.h" + +#include "utils/thread_safe.h" +#include + +#define STB_IMAGE_WRITE_IMPLEMENTATION +#include "stb_image_write.h" + +void write_image( + vk::raii::Device & device, + thread_safe & queue, + uint32_t queue_family_index, + const std::filesystem::path & path, + vk::Image image, + const vk::ImageCreateInfo & info) +{ + assert(info.usage & vk::ImageUsageFlagBits::eTransferSrc); + assert(info.extent.depth == 1); + assert(info.format == vk::Format::eR8G8B8A8Srgb); + + buffer_allocation output_buffer{ + device, + vk::BufferCreateInfo{ + .size = info.extent.height * info.extent.width * 4, + .usage = vk::BufferUsageFlagBits::eTransferDst, + }, + VmaAllocationCreateInfo{ + .flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT, + .usage = VmaMemoryUsage::VMA_MEMORY_USAGE_AUTO, + }, + "Saved image buffer"}; + + vk::raii::CommandPool cp{ + device, + vk::CommandPoolCreateInfo{ + .queueFamilyIndex = queue_family_index, + }}; + + vk::raii::CommandBuffer command_buffer = std::move(device.allocateCommandBuffers( + { + .commandPool = *cp, + .level = vk::CommandBufferLevel::ePrimary, + .commandBufferCount = 1, + })[0]); + + vk::raii::Fence fence = device.createFence({}); + + command_buffer.begin(vk::CommandBufferBeginInfo{}); + + command_buffer.pipelineBarrier( + vk::PipelineStageFlagBits::eColorAttachmentOutput, + vk::PipelineStageFlagBits::eTransfer, + vk::DependencyFlags{}, + {}, + {}, + vk::ImageMemoryBarrier{ + .srcAccessMask = vk::AccessFlagBits::eColorAttachmentWrite, + .dstAccessMask = vk::AccessFlagBits::eTransferRead, + .oldLayout = vk::ImageLayout::eColorAttachmentOptimal, + .newLayout = vk::ImageLayout::eTransferSrcOptimal, + .image = image, + .subresourceRange = { + .aspectMask = vk::ImageAspectFlagBits::eColor, + .baseMipLevel = 0, + .levelCount = 1, + .baseArrayLayer = 0, + .layerCount = 1, + }, + }); + + command_buffer.copyImageToBuffer( + image, + vk::ImageLayout::eTransferSrcOptimal, + output_buffer, + vk::BufferImageCopy{ + .bufferOffset = 0, + .bufferRowLength = 0, + .bufferImageHeight = 0, + .imageSubresource = { + .aspectMask = vk::ImageAspectFlagBits::eColor, + .mipLevel = 0, + .baseArrayLayer = 0, + .layerCount = 1, + }, + .imageOffset = {0, 0, 0}, + .imageExtent = info.extent, + }); + + command_buffer.end(); + queue.lock()->submit(vk::SubmitInfo{ + .commandBufferCount = 1, + .pCommandBuffers = &*command_buffer, + }, + *fence); + + if (auto result = device.waitForFences(*fence, true, 1'000'000'000); result == vk::Result::eSuccess) + stbi_write_png(path.c_str(), info.extent.width, info.extent.height, 4, output_buffer.data(), 0); +} diff --git a/client/render/image_writer.h b/client/render/image_writer.h new file mode 100644 index 00000000..474b7651 --- /dev/null +++ b/client/render/image_writer.h @@ -0,0 +1,42 @@ +/* + * WiVRn VR streaming + * Copyright (C) 2025 Guillaume Meunier + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "utils/thread_safe.h" +#include "vk/allocation.h" +#include +#include + +void write_image( + vk::raii::Device & device, + thread_safe & queue, + uint32_t queue_family_index, + const std::filesystem::path & path, + vk::Image image, + const vk::ImageCreateInfo & info); + +inline void write_image( + vk::raii::Device & device, + thread_safe & queue, + uint32_t queue_family_index, + const std::filesystem::path & path, + const image_allocation & image) +{ + write_image(device, queue, queue_family_index, path, (vk::Image)image, image.info()); +} diff --git a/client/scenes/lobby_gui_customize.cpp b/client/scenes/lobby_gui_customize.cpp index 772bb44f..e3b63def 100644 --- a/client/scenes/lobby_gui_customize.cpp +++ b/client/scenes/lobby_gui_customize.cpp @@ -26,12 +26,18 @@ #include "imgui.h" #include "imgui_internal.h" #include "imspinner.h" +#include "render/image_writer.h" +#include "render/scene_renderer.h" #include "utils/files.h" #include "utils/i18n.h" #include "utils/json_string.h" +#include "vk/allocation.h" #include #include #include +#include +#include +#include #include "IconsFontAwesome6.h" @@ -53,8 +59,12 @@ void scenes::lobby::save_environment_json() << ",\"description\":" << json_string(model.description) << ",\"screenshot\":" << json_string(model.screenshot_url) << ",\"url\":" << json_string(model.gltf_url) - << ",\"size\":" << model.size - << "},"; + << ",\"size\":" << model.size; + + // TODO only if not the default value + ss << ",\"local_screenshot\":" << json_string(model.local_screenshot_path); + ss << ",\"local_path\":" << json_string(model.local_gltf_path); + ss << "},"; } if (not empty) ss.seekp(-1, ss.cur); @@ -112,8 +122,16 @@ std::vector scenes::lobby::load_environment_js model.size = val.get_int64(); model.builtin = false; - model.local_screenshot_path = application::get_config_path() / "environments" / (model.name + ".png"); - model.local_gltf_path = application::get_config_path() / "environments" / (model.name + ".glb"); + + if (auto val = i["local_screenshot"]; val.is_string()) + model.local_screenshot_path = val.get_string().value(); + else + model.local_screenshot_path = application::get_config_path() / "environments" / (model.name + ".png"); + + if (auto val = i["local_path"]; val.is_string()) + model.local_gltf_path = val.get_string().value(); + else + model.local_gltf_path = application::get_config_path() / "environments" / (model.name + ".glb"); models.push_back(std::move(model)); } @@ -180,18 +198,95 @@ void scenes::lobby::update_file_picker() load_environment_status = ""; future_environment = utils::async>, float>( [this](auto token, file_picker_result environment) { - auto local_path = application::get_cache_path() / "local.glb"; + auto t = std::chrono::system_clock::now(); + auto local_path = application::get_cache_path() / fmt::format("local-{:%F-%T}.glb", t); + auto local_screenshot_path = application::get_cache_path() / fmt::format("local-{:%F-%T}.png", t); utils::write_whole_file(local_path, (std::span)environment.file); - // TODO remove only local.glb from cache - clear_gltf_cache(); + environment_model model{ + .name = _S("Locally loaded environment"), + .author = "", + .description = "", + .screenshot_url = "", + .gltf_url = fmt::format("local-{:%F-%T}", t), // Used as key + .size = environment.file.size(), + .local_screenshot_path = local_screenshot_path, + .local_gltf_path = local_path, + }; - return std::make_pair( - local_path, - load_gltf(local_path, [&](float progress) { - token.set_progress(progress); - })); + int n = 2; + while (std::ranges::find(local_environments, model.name, &environment_model::name) != local_environments.end()) + { + model.name = fmt::format(_F("Locally loaded environment ({})"), n++); + } + + local_environments.push_back(model); + std::ranges::sort(local_environments, std::less{}); + save_environment_json(); + + std::shared_ptr env = load_gltf(local_path, [&](float progress) { token.set_progress(progress); }); + + // Create a screenshot of the loaded environment + scene_renderer::frame_info frame{ + .projection = projection_matrix( + XrFovf{ + .angleLeft = -0.7, + .angleRight = 0.7, + .angleUp = 0.7, + .angleDown = -0.7, + }, + constants::lobby::near_plane), + .view = view_matrix(XrPosef{ + .orientation = {0, 0, 0, 1}, + .position = {0, 1.6, 0}, + })}; + + image_allocation output{ + device, + vk::ImageCreateInfo{ + .imageType = vk::ImageType::e2D, + .format = vk::Format::eR8G8B8A8Srgb, + .extent = {512, 512, 1}, + .mipLevels = 1, + .arrayLayers = 1, + .usage = vk::ImageUsageFlagBits::eColorAttachment | vk::ImageUsageFlagBits::eTransferSrc, + }, + VmaAllocationCreateInfo{ + .usage = VmaMemoryUsage::VMA_MEMORY_USAGE_AUTO, + }, + "Screenshot image", + }; + + scene_renderer local_renderer{device, physical_device, queue, queue_family_index}; + local_renderer.start_frame(); + local_renderer.render( + *env, + { + constants::lobby::sky_color.r, + constants::lobby::sky_color.g, + constants::lobby::sky_color.b, + constants::lobby::sky_color.a, + }, + layer_lobby, + vk::Extent2D{ + output.info().extent.width, + output.info().extent.height, + + }, // Output size + output.info().format, // Output format + vk::Format::eD32Sfloat, // Depth format + output, // Output image + vk::Image{}, // Depth image + vk::Image{}, // Foveation image + {&frame, 1}, // View info + false); + local_renderer.end_frame(); + local_renderer.wait_idle(); // TODO get a semaphore from end_frame instead + + write_image(device, queue, queue_family_index, local_screenshot_path, output); + + return std::make_pair(local_path, env); }, lobby_file_picker_future.get()); } diff --git a/common/vk/allocation.h b/common/vk/allocation.h index 32dc17b9..38d04584 100644 --- a/common/vk/allocation.h +++ b/common/vk/allocation.h @@ -93,11 +93,21 @@ public: return *resource; } + operator const T() const + { + return *resource; + } + operator CType() { return CType(*resource); } + operator const CType() const + { + return CType(*resource); + } + operator bool() const { return *resource; From 3621404e7147fccca132cefb5bffc8897c845330 Mon Sep 17 00:00:00 2001 From: Guillaume Meunier Date: Mon, 1 Dec 2025 18:03:57 +0100 Subject: [PATCH 08/10] Convert Java exceptions to C++ exceptions --- client/android/jnipp.cpp | 36 ++++++++++++++++++++++++++++++++ client/android/jnipp.h | 44 ++++++++++++++++++++++++++++++++++++---- 2 files changed, 76 insertions(+), 4 deletions(-) create mode 100644 client/android/jnipp.cpp diff --git a/client/android/jnipp.cpp b/client/android/jnipp.cpp new file mode 100644 index 00000000..abc9f49a --- /dev/null +++ b/client/android/jnipp.cpp @@ -0,0 +1,36 @@ +/* + * WiVRn VR streaming + * Copyright (C) 2025 Guillaume Meunier + * Copyright (C) 2025 Patrick Nicolas + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "jnipp.h" + +namespace jni::details +{ +void handle_java_exception() +{ + auto & env = jni_thread::env(); + if (auto exc = env.ExceptionOccurred()) + { + env.ExceptionClear(); + + std::string str = object<"java/lang/Object">{exc}.call("toString"); + + throw std::runtime_error("Java exception " + str); + } +} +} // namespace jni::details diff --git a/client/android/jnipp.h b/client/android/jnipp.h index d9fd8994..4c0ed55d 100644 --- a/client/android/jnipp.h +++ b/client/android/jnipp.h @@ -25,6 +25,7 @@ #include #include +#include namespace jni { @@ -171,6 +172,9 @@ struct type_map template using type_map_t = type_map::type; + +void handle_java_exception(); + } // namespace details struct klass @@ -215,7 +219,17 @@ struct klass assert(method_id); auto handles = details::handle(std::forward(args)...); return R(std::apply([&](auto &... t) { - return (env.*R1::call_static_method)(*this, method_id, t...); + if constexpr (std::is_void_v) + { + (env.*R1::call_static_method)(*this, method_id, t...); + details::handle_java_exception(); + } + else + { + auto res = (env.*R1::call_static_method)(*this, method_id, t...); + details::handle_java_exception(); + return res; + } }, handles)); } @@ -283,7 +297,17 @@ struct object assert(method_id); auto handles = details::handle(std::forward(args)...); return R(std::apply([&](auto &... t) { - return (env.*R1::call_method)(*this, method_id, t...); + if constexpr (std::is_void_v) + { + (env.*R1::call_method)(*this, method_id, t...); + details::handle_java_exception(); + } + else + { + auto res = (env.*R1::call_method)(*this, method_id, t...); + details::handle_java_exception(); + return res; + } }, handles)); } @@ -296,7 +320,17 @@ struct object assert(method_id); auto handles = details::handle(std::forward(args)...); return R(std::apply([&](auto &... t) { - return (env.*R1::call_method)(*this, method_id, t...); + if constexpr (std::is_void_v) + { + (env.*R1::call_method)(*this, method_id, t...); + details::handle_java_exception(); + } + else + { + auto res = (env.*R1::call_method)(*this, method_id, t...); + details::handle_java_exception(); + return res; + } }, handles)); } @@ -327,7 +361,9 @@ static object new_object(Args &&... args) assert(method_id); auto handles = details::handle(std::forward(args)...); return object(std::apply([&](auto &... t) { - return env.NewObject(klass, method_id, t...); + auto res = env.NewObject(klass, method_id, t...); + details::handle_java_exception(); + return res; }, handles)); } From 20cf6ea2e0c77b3b15b44ee7621a7069e046ffca Mon Sep 17 00:00:00 2001 From: Guillaume Meunier Date: Mon, 1 Dec 2025 19:00:16 +0100 Subject: [PATCH 09/10] Display errors in GUI when loading local environments --- client/scenes/lobby_gui_customize.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/client/scenes/lobby_gui_customize.cpp b/client/scenes/lobby_gui_customize.cpp index e3b63def..cf826806 100644 --- a/client/scenes/lobby_gui_customize.cpp +++ b/client/scenes/lobby_gui_customize.cpp @@ -293,6 +293,7 @@ void scenes::lobby::update_file_picker() catch (std::exception & e) { spdlog::warn("Cannot load local environment: {}", e.what()); + load_environment_status = fmt::format(_F("Cannot load local environment: {}"), e.what()); } } From ab2ee24e902f06d93761086cf0302ded25111783 Mon Sep 17 00:00:00 2001 From: BlackCherryCat Date: Tue, 2 Dec 2025 20:12:53 +0100 Subject: [PATCH 10/10] Update es locale --- locale/es/wivrn-dashboard.po | 32 +++++++++--------- locale/es/wivrn.po | 64 ++++++++++++++++++++++-------------- 2 files changed, 57 insertions(+), 39 deletions(-) diff --git a/locale/es/wivrn-dashboard.po b/locale/es/wivrn-dashboard.po index 70bb26c9..a9468904 100644 --- a/locale/es/wivrn-dashboard.po +++ b/locale/es/wivrn-dashboard.po @@ -16,6 +16,8 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Generator: Lokalize 25.08.3\n" +"X-Language: es\n" +"X-Source-Language: en\n" #: dashboard/apk_installer.cpp:137 #, kde-format @@ -103,13 +105,13 @@ msgstr "" #: dashboard/qml/ApkInstallPage.qml:51 dashboard/qml/WizardPage.qml:204 #, kde-format msgid "" -"Follow the instructions in the documentation to build your own " -"client." +"Follow the instructions in the documentation " +"to build your own client." msgstr "" -"Sigue las instrucciones en la documentación para compilar tu " -"propio cliente." +"Sigue las instrucciones en la documentación " +"para compilar tu propio cliente." #: dashboard/qml/ApkInstallPage.qml:65 dashboard/qml/HeadsetsPage.qml:183 #: dashboard/qml/HeadsetStatsPage.qml:36 dashboard/qml/TroubleshootPage.qml:67 @@ -292,14 +294,14 @@ msgstr "" #, kde-format msgid "Steam is installed as a snap. Snaps are not compatible with WiVRn." msgstr "" -"Steam está instalado mediante snap. Los Snaps no son compatibles con WiVRn" +"Steam está instalado mediante snap. Los Snaps no son compatibles con WiVRn." #: dashboard/qml/Main.qml:183 #, kde-format msgid "" "Steam is installed as a flatpak but does not have sufficient permissions." msgstr "" -"Steam está instalado con flatpak, pero no tiene los suficientes permisos" +"Steam está instalado con flatpak, pero no tiene los suficientes permisos." #: dashboard/qml/Main.qml:198 #, kde-format @@ -476,7 +478,7 @@ msgstr "Restablecer" #: dashboard/qml/SettingsPage.qml:116 #, kde-format msgid "Encoder:" -msgstr "Codificador" +msgstr "Codificador:" #: dashboard/qml/SettingsPage.qml:122 #, kde-format @@ -512,7 +514,7 @@ msgstr "\"Auto\" utilizará aceleración por hardware si está disponible" #: dashboard/qml/SettingsPage.qml:160 #, kde-format msgid "Codec:" -msgstr "Códec" +msgstr "Códec:" #: dashboard/qml/SettingsPage.qml:166 #, kde-format @@ -573,7 +575,7 @@ msgid "" msgstr "" "El teclado y ratón conectados al cliente actuarán como si se hubiesen " "conectado al servidor. El SO del cliente podria reservarse ciertas teclas y " -"combinaciones, los cuales no podrán ser enviados" +"combinaciones, los cuales no podrán ser enviados." #: dashboard/qml/SettingsPage.qml:241 #, kde-format @@ -719,9 +721,9 @@ msgstr "Tengo un error de \"Servidor WiVRn incompatible\" en mi visor" #: dashboard/qml/TroubleshootPage.qml:37 #, kde-format msgid "" -"

The version of the headset app and the server on your computer must match." -"

  • The headset app version is in the \"About\" page
  • The " -"server version is %1
" +"

The version of the headset app and the server on your computer must " +"match.

  • The headset app version is in the \"About\" " +"page
  • The server version is %1
" msgstr "" "

La versión de la aplicación del visor y la del servidor en tu computadora " "deben coincidir.

  • La versión de la aplicación del visor está en la " @@ -909,7 +911,7 @@ msgid "" "running." msgstr "" "WiVRn sustituye completamente a SteamVR, no deberías iniciar SteamVR " -"mientras WiVRn esté en ejecución" +"mientras WiVRn esté en ejecución." #: dashboard/qml/WizardPage.qml:359 #, kde-format diff --git a/locale/es/wivrn.po b/locale/es/wivrn.po index 4645b657..f411930c 100644 --- a/locale/es/wivrn.po +++ b/locale/es/wivrn.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: WiVRn 0.15\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-17 21:03+0100\n" +"POT-Creation-Date: 2025-12-02 19:57+0100\n" "PO-Revision-Date: 2025-11-19 20:23+0100\n" "Last-Translator: Álvaro De Quinta \n" "Language-Team: Spanish <>\n" @@ -15,6 +15,8 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Generator: Lokalize 25.08.3\n" +"X-Language: es\n" +"X-Source-Language: en\n" #: client/scene.cpp:73 msgid "No supported swapchain format" @@ -31,19 +33,19 @@ msgstr "Connectado a {}" #: client/scenes/app_launcher.cpp:136 msgid "Start an application on the server to start streaming." -msgstr "Inicia una aplicación en el servidor para empezar la retransmisión" +msgstr "Inicia una aplicación en el servidor para empezar la retransmisión." #: client/scenes/app_launcher.cpp:146 msgid "Start an application on your computer or select one to start streaming." msgstr "" "Inicia una aplicación en tu ordenador o selecciona una para empezar la " -"retransmisión" +"retransmisión." #: client/scenes/app_launcher.cpp:148 #, c++-format msgid "Start an application on {} or select one to start streaming." msgstr "" -"Inicia una aplicación en {} o selecciona una para empezar la retransmisión" +"Inicia una aplicación en {} o selecciona una para empezar la retransmisión." #: client/scenes/lobby.cpp:230 msgid "Incompatible WiVRn server: no protocol field in TXT" @@ -96,9 +98,9 @@ msgstr "Deshabilitado" msgid "Disconnect" msgstr "Desconectar" -#: client/scenes/lobby_gui.cpp:132 client/scenes/lobby_gui_customize.cpp:653 -#: client/scenes/lobby_gui_customize.cpp:744 -#: client/scenes/lobby_gui_customize.cpp:800 client/scenes/stream_gui.cpp:963 +#: client/scenes/lobby_gui.cpp:132 client/scenes/lobby_gui_customize.cpp:749 +#: client/scenes/lobby_gui_customize.cpp:840 +#: client/scenes/lobby_gui_customize.cpp:896 client/scenes/stream_gui.cpp:963 msgid "Close" msgstr "Cerrar" @@ -135,7 +137,7 @@ msgstr "Puerto" msgid "TCP only" msgstr "Solo TCP" -#: client/scenes/lobby_gui.cpp:317 client/scenes/lobby_gui_customize.cpp:555 +#: client/scenes/lobby_gui.cpp:317 client/scenes/lobby_gui_customize.cpp:651 #: client/scenes/stream_gui.cpp:920 msgid "Cancel" msgstr "Cancelar" @@ -252,7 +254,7 @@ msgstr "Activar seguimiento de manos" #: client/scenes/lobby_gui.cpp:709 client/scenes/lobby_gui.cpp:721 #: client/scenes/lobby_gui.cpp:733 client/scenes/lobby_gui.cpp:750 -#: client/scenes/lobby_gui_customize.cpp:540 +#: client/scenes/lobby_gui_customize.cpp:636 msgid "This feature is not supported by your headset" msgstr "Esta función no es compatible con tu visor" @@ -482,33 +484,47 @@ msgstr "" msgid "Press the grip button to move the main window" msgstr "Pulsa el botón de agarre para mover la ventana principal" -#: client/scenes/lobby_gui_customize.cpp:233 +#: client/scenes/lobby_gui_customize.cpp:208 +msgid "Locally loaded environment" +msgstr "Entorno local cargado" + +#: client/scenes/lobby_gui_customize.cpp:221 +#, c++-format +msgid "Locally loaded environment ({})" +msgstr "Entorno local ({}) cargado" + +#: client/scenes/lobby_gui_customize.cpp:296 +#, c++-format +msgid "Cannot load local environment: {}" +msgstr "No se ha podido cargar el entorno local: {}" + +#: client/scenes/lobby_gui_customize.cpp:329 #, c++-format msgid "Cannot load environment list: {}" msgstr "No se ha podido cargar la lista del entorno: {}" -#: client/scenes/lobby_gui_customize.cpp:363 +#: client/scenes/lobby_gui_customize.cpp:459 #, c++-format msgid "Author: {}" msgstr "Autor: {}" -#: client/scenes/lobby_gui_customize.cpp:367 +#: client/scenes/lobby_gui_customize.cpp:463 #, c++-format msgid "Size: {:.1f} MB" msgstr "Tamaño: {:.1f} MB" -#: client/scenes/lobby_gui_customize.cpp:447 +#: client/scenes/lobby_gui_customize.cpp:543 msgid "Delete this model" msgstr "Borrar este modelo" -#: client/scenes/lobby_gui_customize.cpp:483 -#: client/scenes/lobby_gui_customize.cpp:689 +#: client/scenes/lobby_gui_customize.cpp:579 +#: client/scenes/lobby_gui_customize.cpp:785 #, c++-format msgid "HTTP error {} when downloading {}" msgstr "Error HTTP {} mientras se descargaba {}" -#: client/scenes/lobby_gui_customize.cpp:491 -#: client/scenes/lobby_gui_customize.cpp:697 +#: client/scenes/lobby_gui_customize.cpp:587 +#: client/scenes/lobby_gui_customize.cpp:793 #, c++-format msgid "" "Curl error when downloading {}\n" @@ -517,29 +533,29 @@ msgstr "" "Error de Curl mientras se descargaba {}\n" "{}: {}" -#: client/scenes/lobby_gui_customize.cpp:552 +#: client/scenes/lobby_gui_customize.cpp:648 #, c++-format msgid "Really delete {}?" msgstr "Seguro que quiere borrar {}?" -#: client/scenes/lobby_gui_customize.cpp:556 +#: client/scenes/lobby_gui_customize.cpp:652 msgid "Delete" msgstr "Borrar" -#: client/scenes/lobby_gui_customize.cpp:637 +#: client/scenes/lobby_gui_customize.cpp:733 #, c++-format msgid "Cannot load environment: {}" msgstr "No se puede cargar el entorno: {}" -#: client/scenes/lobby_gui_customize.cpp:645 +#: client/scenes/lobby_gui_customize.cpp:741 msgid "Loading environment" msgstr "Cargando entorno" -#: client/scenes/lobby_gui_customize.cpp:724 +#: client/scenes/lobby_gui_customize.cpp:820 msgid "Download more environments" msgstr "Descargar más entornos" -#: client/scenes/lobby_gui_customize.cpp:732 +#: client/scenes/lobby_gui_customize.cpp:828 msgid "Open local glTF model" msgstr "Abrir modelo glTF local" @@ -697,7 +713,7 @@ msgstr "No se puede verificar el PIN" #: client/wivrn_client.cpp:182 msgid "Pairing is disabled on server" -msgstr "El emparejamiento está deshabilitado en el servidor." +msgstr "El emparejamiento está deshabilitado en el servidor" #, c++-format #~ msgid "HTTP error {} when downloading index.json"