RenderKit / ospray

An Open, Scalable, Portable, Ray Tracing Based Rendering Engine for High-Fidelity Visualization
http://ospray.org
Apache License 2.0
1.02k stars 186 forks source link

Constant colored material with scivis renderer? #320

Closed paulmelis closed 5 years ago

paulmelis commented 5 years ago

Is there a way, with the scivis renderer, to get constant surface shading, i.e. one that disregards the surface normal and lights? The OBJ Material provides control over diffuse and specular components, but does not have an ambient term (I would normally set diffuse and specular contributions to black to get pure ambient).

samcaulfield commented 5 years ago

Rendering the OSP_FB_ALBEDO channel in the frame buffer produces an image that technically has constant lighting contribution of 0 because all illumination sources are ignored.

Then you could either:

johguenther commented 5 years ago

Wow, creative suggestion to use the albedo frambuffer channel , didn't think about that one :-)

One other way may be to use just one ambient light, and set aoSamples to zero (i.e., disabling shadow), which results in ambient illumination (on the diffuse color).

carsonbrownlee commented 5 years ago

Johannes suggestion is the expected route to achieve ambient only lighting, making sure to remove any other other lights.

paulmelis commented 5 years ago

One other way may be to use just one ambient light, and set aoSamples to zero (i.e., disabling shadow), which results in ambient illumination (on the diffuse color).

Okay, thanks, that indeed does what I wanted. By the way, "disabling shadow" put me on the wrong foot, as there is the separate shadowsEnabled flag, but that has nothing to do with AO in ospray, right?

PS I usually also forget that one can do tricks in image space as alternative for the pure rendering-based solution :wink:

carsonbrownlee commented 5 years ago

AO and shadows are indeed different. There should be no shadows with only an ambient light, however; so that shouldn't actually do anything. While the image buffer approach is valid, it would incur overhead over just rendering pure ambient lighting as computing unnecessary lighting would be additional compute as well as the albedo buffer.

johguenther commented 5 years ago

Yes, just to confirm: in SciVis renderer, shadowing (from point and directional lights) is controlled via shadowsEnabled. Ambient intensity is inferred from the ambient light, and the quality of Ambient Occlusion is controlled via aoSamples. Using zero AO samples disables AO shadowing, but ambient illumination is still in effect.