Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use texture switch #440

Merged
merged 5 commits into from
Dec 25, 2023
Merged

Use texture switch #440

merged 5 commits into from
Dec 25, 2023

Conversation

roeas
Copy link
Contributor

@roeas roeas commented Dec 18, 2023

Snipaste_2023-12-22_16-01-00
Snipaste_2023-12-22_16-01-04

Properties that do not use textures display "No Resources".
Also removes the warning about no textures in ECWorldConsumer::AddMaterial.

@roeas roeas changed the title update Use texture switch Dec 18, 2023
@roeas
Copy link
Contributor Author

roeas commented Dec 22, 2023

Heres a bug:

ImGuiUtils::ImGuiBoolProperty("Use texture", pPropertyGroup->useTexture);

if (pPropertyGroup->useTexture)
{
	pMaterialComponent->ActivateShaderFeature(engine::MaterialTextureTypeToShaderFeature.at(textureType));
}
else
{
	pMaterialComponent->DeactivateShaderFeature(engine::MaterialTextureTypeToShaderFeature.at(textureType));
}

Due to the different granularity of the useTexture of ORM PropertyGroup and the ShaderFeature of ORM, it is difficult to control the switching of the ORM ShaderFeature with the useTexture checkbox on UI.
Given that we've already implemented the lazy and hot reloading of shaders, perhaps we could split the ShaderFeature::ORM?

@roeas roeas requested a review from T-rvw December 22, 2023 11:37
@T-rvw
Copy link
Contributor

T-rvw commented Dec 25, 2023

Heres a bug:

ImGuiUtils::ImGuiBoolProperty("Use texture", pPropertyGroup->useTexture);

if (pPropertyGroup->useTexture)
{
	pMaterialComponent->ActivateShaderFeature(engine::MaterialTextureTypeToShaderFeature.at(textureType));
}
else
{
	pMaterialComponent->DeactivateShaderFeature(engine::MaterialTextureTypeToShaderFeature.at(textureType));
}

Due to the different granularity of the useTexture of ORM PropertyGroup and the ShaderFeature of ORM, it is difficult to control the switching of the ORM ShaderFeature with the useTexture checkbox on UI. Given that we've already implemented the lazy and hot reloading of shaders, perhaps we could split the ShaderFeature::ORM?

ORM is a project logic which will be removed in the editor/engine finally. The correct way is to write a MaterialGraph. Then PBR material node exports Occulsion, Roughness, Metalness float values to user. User can choose Texture node's R/G/B/A to output to the input of PBR material node. Reference to Maya/Blender/Unreal's material graph design is OK.

And logics about BaseColor/Normal/... will also be removed in the future. A good design is to transfer these settings to a material type metadata file. Editor/Engine codes only care about very generic settings : parameters(CBuffer), resources(2d/3d/procedural/... textures), samplers(how to use texture), render states(blend/alpha/...)

@roeas roeas merged commit 9c6fa61 into main Dec 25, 2023
2 of 3 checks passed
@roeas roeas deleted the use_texture branch December 25, 2023 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants