qdtk / openshadinglanguage

Automatically exported from code.google.com/p/openshadinglanguage
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Environment Map Format Lookup functions #22

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
May we get lookup functions for the different environment map format types 
similar to the current Arnold:

AI_HDRI_MIRRORED_BALL: AiMappingMirroredBall?(&dir, &sg->u, &sg->v); 
AI_HDRI_ANGULAR_MAP: 
AiMappingAngularMap?(&dir, &sg->u, &sg->v); AI_HDRI_LAT_LONG: 
AiMappingLatLong?(&dir, &sg->u, 
&sg->v); AI_HDRI_CUBIC_MAP: AiMappingCubicMap?(&dir, &sg->u, &sg->v);

or even better...perhaps an equivalent of environment()?

11/03/09 17:27:40 changed by abauer 

+1

I need exactly these same functions for the projection shader as well.
If OSL won't offer them built-in I'd have to roll my own...
(No big deal, just adding another 'yes please!' voice!)

11/12/09 09:35:05 changed by lg 

The plan is that eventually the built-in environment() routine will handle all 
these mappings internally, i.e. 
you will not need to call separate routines for each projection type, and the 
shader won't even need to 
know (it will just be a property of the map).

But this is unimplemented yet, and unless you guys say so, I hadn't considered 
it at the top of the priority 
list.

Since we have code readily available that do the projections, and they can 
easily be implemented in OSL 
itself, I recommend that you guys just code them up yourself for now. At some 
later point when 
environment() is fully implemented, we can rip that out and your shader will 
get much simpler.

But do feel free to tell me that it's important to implement it right away in 
the language core rather than 
having you guys do it as OSL functions if you think that's more important than 
other things high in the 
priority queue.

11/13/09 03:42:30 changed by fajardom

attachment test_0414.jpg added.
11/13/09 03:59:04 changed by fajardom

attachment test_0414_ref.jpg added.
11/13/09 04:00:33 changed by fajardom 

This needs work on OIIO, which doesn't yet provide an environment() texture 
lookup. In particular, there's 
no support for proper filtering in cubic (aka vertical cross) maps, so we are 
currently getting ugly seams 
between the cube faces. We have a test in the <edit> testsuite that is failing 
for exactly this reason:

test_0414 FAILED: cubic mapping format in sky shader

100% reflective sphere with a cubic environment map.
Note that care is taken in the texture filtering code to
avoid "seams" between cube faces.
<edit>

11/13/09 08:39:24 changed by jschlag 

<edit>

Original issue reported on code.google.com by rene.lim...@gmail.com on 11 Jan 2010 at 6:44

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago

Original comment by rene.lim...@gmail.com on 13 Jan 2010 at 1:27

GoogleCodeExporter commented 9 years ago
In progress, first stage under review.

Original comment by larrygr...@gmail.com on 23 Feb 2011 at 7:47