/*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* These textures are based off version of Wave engine sample
* Take from https://github.com/WaveEngine/Samples
*
- * Copyright (c) 2023 Wave Coorporation
+ * Copyright (c) 2024 Wave Coorporation
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
// Check uniform values before change material value
Vector4 expectBaseColorFactor = Vector4(1.000f, 0.766f, 0.336f, 1.0f); // Defined at AnimatedCube.gltf
- float expectTransformValid = 1.0f; ///< Note : This value will be true when gltf have BaseColorTexture.
- float expectMaxLOD = 5.0f; ///< Note : The number of LOD what TEST_SPECULAR_TEXTURE file has is 5.
+ float expectTransformValid = 0.0f; ///< Note : This value will be true when gltf have BaseColorTexture, and use KHR_texture_transform extension.
+ float expectMaxLOD = 5.0f; ///< Note : The number of LOD what TEST_SPECULAR_TEXTURE file has is 5.
tet_printf("Check uniform value result\n");
DALI_TEST_EQUALS(gl.CheckUniformValue<Vector4>("uColorFactor", expectBaseColorFactor), true, TEST_LOCATION);
#endif
#ifdef MORPH
-#define MAX_BLEND_SHAPE_NUMBER 128
+#define MAX_BLEND_SHAPE_NUMBER 256
uniform int uNumberOfBlendShapes; ///< Total number of blend shapes loaded.
uniform highp float uBlendShapeWeight[MAX_BLEND_SHAPE_NUMBER]; ///< The weight of each blend shape.
#ifdef MORPH_VERSION_2_0
static constexpr std::string_view THREE_TEX_KEYWORD = "THREE_TEX";
static constexpr std::string_view GLTF_CHANNELS_KEYWORD = "GLTF_CHANNELS";
-static constexpr Vector3 Y_DIRECTION(1.0f, -1.0f, 1.0f);
+static constexpr Vector3 IBL_BASIS(1.0f, -1.0f, 1.0f);
enum TextureIndex
{
RegisterUniformIfNotDefinedBefore(renderer, "uOcclusionTextureTransformAvailable", 0.0f);
RegisterUniformIfNotDefinedBefore(renderer, "uEmissiveTextureTransformAvailable", 0.0f);
+ RegisterUniformIfNotDefinedBefore(renderer, "uBaseColorTextureTransform", Matrix3::IDENTITY);
+ RegisterUniformIfNotDefinedBefore(renderer, "uNormalRoughnessTextureTransform", Matrix3::IDENTITY);
+ RegisterUniformIfNotDefinedBefore(renderer, "uNormalTextureTransform", Matrix3::IDENTITY);
+ RegisterUniformIfNotDefinedBefore(renderer, "uMetalRoughnessTextureTransform", Matrix3::IDENTITY);
+ RegisterUniformIfNotDefinedBefore(renderer, "uOcclusionTextureTransform", Matrix3::IDENTITY);
+ RegisterUniformIfNotDefinedBefore(renderer, "uEmissiveTextureTransform", Matrix3::IDENTITY);
+
RegisterUniformIfNotDefinedBefore(renderer, "uCubeMatrix", Matrix::IDENTITY);
RegisterUniformIfNotDefinedBefore(renderer, Scene3D::Loader::NodeDefinition::GetIblMaxLodUniformName(), 1.0f);
RegisterUniformIfNotDefinedBefore(renderer, Scene3D::Loader::NodeDefinition::GetIblScaleFactorUniformName(), 1.0f);
- RegisterUniformIfNotDefinedBefore(renderer, Scene3D::Loader::NodeDefinition::GetIblYDirectionUniformName(), Y_DIRECTION);
+ RegisterUniformIfNotDefinedBefore(renderer, Scene3D::Loader::NodeDefinition::GetIblYDirectionUniformName(), IBL_BASIS);
Scene3D::Loader::RendererState::Apply(mRendererState, renderer);
}
/*
- * Copyright (c) 2024 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
{
namespace Loader
{
-const Matrix3 TextureDefinition::DEFAULT_TRANSFORM = Matrix3(1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f);
+const Matrix3 TextureDefinition::DEFAULT_TRANSFORM = Matrix3::IDENTITY;
namespace
{
/*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
renderer.RegisterProperty("uOcclusionTextureTransformAvailable", 0.0f);
renderer.RegisterProperty("uEmissiveTextureTransformAvailable", 0.0f);
+ renderer.RegisterProperty("uBaseColorTextureTransform", Matrix3::IDENTITY);
+ renderer.RegisterProperty("uNormalRoughnessTextureTransform", Matrix3::IDENTITY);
+ renderer.RegisterProperty("uNormalTextureTransform", Matrix3::IDENTITY);
+ renderer.RegisterProperty("uMetalRoughnessTextureTransform", Matrix3::IDENTITY);
+ renderer.RegisterProperty("uOcclusionTextureTransform", Matrix3::IDENTITY);
+ renderer.RegisterProperty("uEmissiveTextureTransform", Matrix3::IDENTITY);
+
auto iTexture = matDef.mTextureStages.begin();
auto checkStage = [&](uint32_t flags) {
return iTexture != matDef.mTextureStages.end() && MaskMatch(iTexture->mSemantic, flags);
if(checkStage(MaterialDefinition::ALBEDO | MaterialDefinition::METALLIC))
{
- renderer.RegisterProperty("uBaseColorTextureTransformAvailable", 1.0f);
+ renderer.RegisterProperty("uBaseColorTextureTransformAvailable", iTexture->mTexture.mTransform != Matrix3::IDENTITY);
renderer.RegisterProperty("uBaseColorTextureTransform", iTexture->mTexture.mTransform);
++iTexture;
if(checkStage(MaterialDefinition::NORMAL | MaterialDefinition::ROUGHNESS))
{
- renderer.RegisterProperty("uNormalRoughnessTextureTransformAvailable", 1.0f);
+ renderer.RegisterProperty("uNormalRoughnessTextureTransformAvailable", iTexture->mTexture.mTransform != Matrix3::IDENTITY);
renderer.RegisterProperty("uNormalRoughnessTextureTransform", iTexture->mTexture.mTransform);
++iTexture;
}
}
else if(checkStage(MaterialDefinition::ALBEDO))
{
- renderer.RegisterProperty("uBaseColorTextureTransformAvailable", 1.0f);
+ renderer.RegisterProperty("uBaseColorTextureTransformAvailable", iTexture->mTexture.mTransform != Matrix3::IDENTITY);
renderer.RegisterProperty("uBaseColorTextureTransform", iTexture->mTexture.mTransform);
++iTexture;
}
if(checkStage(MaterialDefinition::METALLIC | MaterialDefinition::ROUGHNESS))
{
- renderer.RegisterProperty("uMetalRoughnessTextureTransformAvailable", 1.0f);
+ renderer.RegisterProperty("uMetalRoughnessTextureTransformAvailable", iTexture->mTexture.mTransform != Matrix3::IDENTITY);
renderer.RegisterProperty("uMetalRoughnessTextureTransform", iTexture->mTexture.mTransform);
++iTexture;
}
if(checkStage(MaterialDefinition::NORMAL))
{
- renderer.RegisterProperty("uNormalTextureTransformAvailable", 1.0f);
+ renderer.RegisterProperty("uNormalTextureTransformAvailable", iTexture->mTexture.mTransform != Matrix3::IDENTITY);
renderer.RegisterProperty("uNormalTextureTransform", iTexture->mTexture.mTransform);
++iTexture;
}
if(checkStage(MaterialDefinition::OCCLUSION))
{
- renderer.RegisterProperty("uOcclusionTextureTransformAvailable", 1.0f);
+ renderer.RegisterProperty("uOcclusionTextureTransformAvailable", iTexture->mTexture.mTransform != Matrix3::IDENTITY);
renderer.RegisterProperty("uOcclusionTextureTransform", iTexture->mTexture.mTransform);
++iTexture;
}
if(checkStage(MaterialDefinition::EMISSIVE))
{
- renderer.RegisterProperty("uEmissiveTextureTransformAvailable", 1.0f);
+ renderer.RegisterProperty("uEmissiveTextureTransformAvailable", iTexture->mTexture.mTransform != Matrix3::IDENTITY);
renderer.RegisterProperty("uEmissiveTextureTransform", iTexture->mTexture.mTransform);
++iTexture;
}