Need to do the same light power as Cycles in Watts for Hydra RPR #34

Merged
Bogdan Nagirniak merged 12 commits from BLEN-386 into hydra-render 2023-05-05 08:42:35 +02:00
Collaborator

Purpose

Adjust lights to match Cycles's results

Technical steps

  • Adjusted intensity
  • Fixed wrong tokens
  • Fixed light update
  • Fixed wrong data types
### Purpose Adjust lights to match Cycles's results ### Technical steps * Adjusted intensity * Fixed wrong tokens * Fixed light update * Fixed wrong data types
Georgiy Markelov added 7 commits 2023-05-02 15:09:34 +02:00
Brian Savery (AMD) was assigned by Georgiy Markelov 2023-05-02 15:10:18 +02:00
Georgiy Markelov self-assigned this 2023-05-02 15:10:19 +02:00
Bogdan Nagirniak was assigned by Georgiy Markelov 2023-05-02 15:10:19 +02:00
Georgiy Markelov requested review from Brian Savery (AMD) 2023-05-02 15:10:27 +02:00
Bogdan Nagirniak requested changes 2023-05-03 09:55:24 +02:00
@ -31,3 +31,3 @@
float intensity = light->energy;
if (scene_delegate_->engine_type == BlenderSceneDelegate::EngineType::PREVIEW) {
intensity *= 0.001;
intensity *= 0.001f;

Do we still need this multiplication?

Do we still need this multiplication?
@ -39,3 +38,3 @@
switch (light->type) {
case LA_LOCAL:
data_[pxr::HdLightTokens->radius] = light->area_size / 2;
data_[pxr::HdLightTokens->radius] = std::max(light->radius, 0.000001f);

if radius == 0, maybe data_[pxr::UsdLuxTokens->treatAsPoint] = true; ?

if radius == 0, maybe `data_[pxr::UsdLuxTokens->treatAsPoint] = true;` ?
@ -83,3 +91,4 @@
prim_type_ = prim_type(light);
/* TODO: temporary value, it should be delivered through Python UI */

Remove this TODO

Remove this TODO
@ -121,6 +130,10 @@ void LightData::update()
write_transform();
bits = pxr::HdLight::DirtyTransform;
}
else if (id->recalc & ID_RECALC_COPY_ON_WRITE) {

Move this check to L125 and check light->id.recalc & ID_RECALC_GEOMETRY

Move this check to L125 and check `light->id.recalc & ID_RECALC_GEOMETRY`
Georgiy Markelov added 1 commit 2023-05-03 17:07:20 +02:00
Brian Savery (AMD) requested changes 2023-05-03 18:52:57 +02:00
@ -25,30 +25,36 @@ void LightData::init()
{
ID_LOG(2, "");
const float round_tolerance = 0.00001f;
Collaborator

the name here is strange. Maybe "radius_threshold". And please add a comment why.

the name here is strange. Maybe "radius_threshold". And please add a comment why.

use FLT_EPSILON

use FLT_EPSILON
Author
Collaborator

Changed round_tolerance -> FLT_EPSILON. Added comment.

Changed round_tolerance -> FLT_EPSILON. Added comment.
@ -42,0 +42,4 @@
else {
data_[pxr::UsdLuxTokens->treatAsPoint] = true;
}
intensity /= 40.0f;
Collaborator

This seems like a strange value. How was this found?

This seems like a strange value. How was this found?
Author
Collaborator

Every value has been found empirically.

Every value has been found empirically.
Georgiy Markelov added 1 commit 2023-05-04 10:11:35 +02:00
Georgiy Markelov requested review from Brian Savery (AMD) 2023-05-04 10:19:21 +02:00
Georgiy Markelov requested review from Bogdan Nagirniak 2023-05-04 10:19:23 +02:00
Bogdan Nagirniak added 2 commits 2023-05-04 12:20:55 +02:00
Bogdan Nagirniak approved these changes 2023-05-04 12:23:11 +02:00
Bogdan Nagirniak left a comment
Owner

Added some fixes. Tested - works good

Added some fixes. Tested - works good
Bogdan Nagirniak added 1 commit 2023-05-04 17:42:20 +02:00
Brian Savery (AMD) approved these changes 2023-05-05 01:59:24 +02:00
Bogdan Nagirniak merged commit 26f2b0b9d5 into hydra-render 2023-05-05 08:42:35 +02:00
Sign in to join this conversation.
No Label
No Milestone
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: BogdanNagirniak/blender#34
No description provided.