This is an old revision of the document!

Corona ShadeContext implementation

Identifying Corona Shade Context

Corona uses 2 shade contexts - one for hit into the scene background (environment), and other for all geometry hits. Their Class_IDs are:

  • Scene geometry hit: a=0x6E816801, b=0xAD8731C5
  • Background (environment maps): a=0x6E816801, b=0xAD8731C6

Using Corona Shade Context

Corona shade contexts try to conform to 3ds Max API specifications as much as possible, but sometimes that is not possible for multiple reasons (confusing or ambiguous API documentation, design differences between a physically based renderer and the old rasterizer architecture the API was created for, …). Notable methods that do not work are:

  • Light()
  • GetEvalObject()
  • NodeID()

You can get additional functionality with the Execute method. When passing 0x0x389A7625 as cmd argument, scene geometry hit ShadeContext will return an unique ID of the currently hit object instance. This can be used for example to randomize color between different instances (build 2015-02-10 and newer)

Log In