patch update - fix sunlight shader
Prend en compte les paramètres direction et intensité
This commit is contained in:
@@ -252,31 +252,36 @@ void imguiManager::WidgetObjectWindow(ApplicationClass* app)
|
||||
app->DeleteKobject(index);
|
||||
}
|
||||
|
||||
// Shader selection
|
||||
std::string shaderLabel = "Shader##" + std::to_string(index);
|
||||
ImGui::Separator();
|
||||
|
||||
// Radio buttons for shader options
|
||||
Object::ShaderType activeShader = object->GetActiveShader();
|
||||
|
||||
if (ImGui::RadioButton("Enable Lighting", activeShader == Object::LIGHTING))
|
||||
// Liste des options
|
||||
const char* shaderOptions[] = { "Enable Global Lighting", "Enable Lighting", "Enable Cel Shading", "Enable Normal Mapping", "Enable Specular Mapping" };
|
||||
Object::ShaderType shaderTypes[] = { Object::SUNLIGHT,Object::LIGHTING, Object::CEL_SHADING, Object::NORMAL_MAPPING, Object::SPECULAR_MAPPING };
|
||||
|
||||
// Variable pour stocker l'option s<>lectionn<6E>e
|
||||
static int currentShader = 0; // Index de l'option actuellement s<>lectionn<6E>e
|
||||
|
||||
// Cr<43>ation du menu d<>roulant
|
||||
if (ImGui::BeginCombo("Shader Options", shaderOptions[currentShader]))
|
||||
{
|
||||
object->SetActiveShader(Object::LIGHTING);
|
||||
}
|
||||
|
||||
if (ImGui::RadioButton("Enable Cel Shading", activeShader == Object::CEL_SHADING))
|
||||
{
|
||||
object->SetActiveShader(Object::CEL_SHADING);
|
||||
}
|
||||
|
||||
if (ImGui::RadioButton("Enable Normal Mapping", activeShader == Object::NORMAL_MAPPING))
|
||||
{
|
||||
object->SetActiveShader(Object::NORMAL_MAPPING);
|
||||
for (int i = 0; i < IM_ARRAYSIZE(shaderOptions); i++)
|
||||
{
|
||||
// Cr<43>e une option s<>lectionnable pour chaque shader
|
||||
bool isSelected = (currentShader == i);
|
||||
if (ImGui::Selectable(shaderOptions[i], isSelected))
|
||||
{
|
||||
// Met <20> jour l'option s<>lectionn<6E>e
|
||||
currentShader = i;
|
||||
object->SetActiveShader(shaderTypes[i]);
|
||||
}
|
||||
|
||||
// Si l'option s<>lectionn<6E>e est active, nous mettons en surbrillance
|
||||
if (isSelected)
|
||||
ImGui::SetItemDefaultFocus();
|
||||
}
|
||||
ImGui::EndCombo();
|
||||
}
|
||||
|
||||
if (ImGui::RadioButton("Enable Specular Mapping", activeShader == Object::SPECULAR_MAPPING))
|
||||
{
|
||||
object->SetActiveShader(Object::SPECULAR_MAPPING);
|
||||
}
|
||||
|
||||
ImGui::Separator();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user