Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
BalajiRam's avatar
BalajiRam
Honored Guest
11 years ago

OculusRoomTiny related query

Hello,

In the OculusRoomTiny sample, the AddSolidColorBox method includes this to determine the Vertex color:

float dist1 = (vvv.Pos - Vector3f(-2,4,-2)).Length();
float dist2 = (vvv.Pos - Vector3f(3,4,-3)).Length();
float dist3 = (vvv.Pos - Vector3f(-4,3,25)).Length();
int bri = rand() % 160;
float RRR = c.R * (bri + 192.0f*(0.65f + 8/dist1 + 1/dist2 + 4/dist3)) / 255.0f;
float GGG = c.G * (bri + 192.0f*(0.65f + 8/dist1 + 1/dist2 + 4/dist3)) / 255.0f;
float BBB = c.B * (bri + 192.0f*(0.65f + 8/dist1 + 1/dist2 + 4/dist3)) / 255.0f;

Any help on what this relation is about ?

I tried changing the "bri" to arbitrary value but did not see a perceivable difference in the output.

Sorry if i missed anything obvious.

Thank you.

Ram

2 Replies

  • I was puzzled by what this is supposed to be doing too. I tried commenting it out and the whole scene looks a bit darker but it's not obvious what is supposed to achieve. If I figure it out I'll let you know!
  • Thanks Matt

    I think i have figured out what it does although i still do not know how it does it :)

    In the scene from that sample, there are a few railings at the end.

    Those railings do not show their edges if the code is commented.

    Regards,
    Ram