Creating new view types for Radiance

Dear all,

I would like to try a new view type for Radiance. So far I have included
the new type in image.c and included a reference in view.h. However, the
compilation is still not working for rpict. I wonder if that could be due
to the modifications I've made (I have already corrected a couple of small
errors) or because I would need to modify also other files. Basically, what
I am asking is what files should be considered in order to include an
alternative view type for rpict and vwrays.

Many thanks,

Victor Lopez-Rioboo Gil

Hi Victor,

Before I answer your question, may I ask what view type you are hoping to add? Depending on what you are doing, it might be easier to write a .cal file, as others have done, most recently for generating stereo panoramas.

Best,
-Greg

···

From: goodriver laurus <[email protected]>
Date: October 26, 2016 11:07:57 PM PDT

Dear all,

I would like to try a new view type for Radiance. So far I have included the new type in image.c and included a reference in view.h. However, the compilation is still not working for rpict. I wonder if that could be due to the modifications I've made (I have already corrected a couple of small errors) or because I would need to modify also other files. Basically, what I am asking is what files should be considered in order to include an alternative view type for rpict and vwrays.

Many thanks,

Victor Lopez-Rioboo Gil

Hi Victor,

I think this conversation is resurrected from old news, but if you're
interested, I implemented equirectangular projection in my fork:
https://github.com/nljones/Accelerad. The only difference is that it's
omni-directional stereo (i.e. up-down dual equirectangular projection). But
it's probably similar to what you're doing.

Nathaniel

···

On Sat, Jul 29, 2017 at 8:50 AM, Gregory J. Ward <[email protected]> wrote:

Hi Victor,

Before I answer your question, may I ask what view type you are hoping to
add? Depending on what you are doing, it might be easier to write a .cal
file, as others have done, most recently for generating stereo panoramas.

Best,
-Greg

*From: *goodriver laurus <[email protected]>

*Date: *October 26, 2016 11:07:57 PM PDT

Dear all,

I would like to try a new view type for Radiance. So far I have included
the new type in image.c and included a reference in view.h. However, the
compilation is still not working for rpict. I wonder if that could be due
to the modifications I've made (I have already corrected a couple of small
errors) or because I would need to modify also other files. Basically, what
I am asking is what files should be considered in order to include an
alternative view type for rpict and vwrays.

Many thanks,

Victor Lopez-Rioboo Gil

_______________________________________________
Radiance-dev mailing list
[email protected]
https://www.radiance-online.org/mailman/listinfo/radiance-dev

Dear all,

I would like to try a new view type for Radiance. So far I have included
the new type in image.c and included a reference in view.h. However, the
compilation is still not working for rpict. I wonder if that could be due
to the modifications I've made (I have already corrected a couple of small
errors) or because I would need to modify also other files. Basically, what
I am asking is what files should be considered in order to include an
alternative view type for rpict and vwrays.

Many thanks,

Victor Lopez-Rioboo Gil

Hi Victor,

You are working in the right place. Besides adding a macro for your view type to view.h, you need to implement the correct operations and checks in viewray() and viewloc() in image.c. For full support, you should also look at util/rad.c and insert your view type in some switch statements therein. Similarly, there is some code you need to write to split up your view for rpiece in util/rpiece.c.

Can you be more specific when you say that your compilation is not working? Do you get compile errors, or is something going wrong at run-time?

Out of curiosity, what type are you adding?

Cheers,
-Greg

···

From: goodriver laurus <[email protected]>
Date: October 28, 2016 12:08:09 AM PDT

Dear all,

I would like to try a new view type for Radiance. So far I have included the new type in image.c and included a reference in view.h. However, the compilation is still not working for rpict. I wonder if that could be due to the modifications I've made (I have already corrected a couple of small errors) or because I would need to modify also other files. Basically, what I am asking is what files should be considered in order to include an alternative view type for rpict and vwrays.

Many thanks,

Victor Lopez-Rioboo Gil

Hi Greg,

Many thanks for that. The view type I am testing is equirectangular
(so I've called it VT_EQR). So far I have modified the following:

common/image.c: setview, viewray and viewloc

common/view.h: Macro for new view type.

util/rad.c: specview

util/rpiece.c: same as for VT_ANG

The compilation looked generally ok with makeall, but there is an
error in my modification of ray.c:
    rad.c: In function ‘specview’:
    rad.c:1224:7: error: ‘VT_EQR’ undeclared (first use in this function)
It is strange because I could not see any of the other types declared there.
Despite the error, rpict seemed to be working, but other programs were
missing (pfilt and pcond at least). I think they were also missing
even before changing ray.c, is that possible?
I've made a quick test and the new projection type seems to work. I've
rendered a squared view (-vh 120 -vv 60) for the following two
scenarios and different view types (VT_PER, VT_ANG, VT_CYL and
VT_EQR):

1- From the centre of a checked sphere (meridians and parallels).

2- From the centre of a box with checked walls.

So far it seems to work!, but I haven't tested all options (vo, va,
vs, vl...). Is there a standard test to check view types?

I've Included the images below. Hopefully they will display.

cube VT_PER

<img src=’/uploads/default/original/1X/0173989acd8ed962052e64fedaa9c11f9e81b22e.png’ width=‘500’ height=‘251’>

cube VT_ANG

<img src=’/uploads/default/original/1X/02e45da11ef4ee13f792f3dda9c7c08b31aca60c.png’ width=‘302’ height=‘251’>

cube VT_CYL

<img src=’/uploads/default/original/1X/0a3d35e11cb6126674530fc2c05123f810501dfb.png’ width=‘500’ height=‘251’>

cube VT_EQR

<img src=’/uploads/default/original/1X/2db83c31503ccd0dee12d713cb7af54959e923cd.png’ width=‘302’ height=‘249’>

sphere VT_PER

<img src=’/uploads/default/original/1X/63e45af2308c5b9cb63e0aa609b70b7e9c3711ec.png’ width=‘500’ height=‘249’>

sphere VT_ANG

<img src=’/uploads/default/original/1X/affb3ab9f50e5de15196aedf0e38a336ecb7384f.png’ width=‘500’ height=‘250’>

sphere VT_CYL

<img src=’/uploads/default/original/1X/da30ddda1d257f77c5b00a3333035c5372b97dfd.png’ width=‘500’ height=‘251’>

sphere VT_EQR

<img src=’/uploads/default/original/1X/48f6045137ca54dffa14363ae60bac2cd7598c2b.png’ width=‘500’ height=‘249’>

Cheers,

Victor Lopez-Rioboo Gil

···

---------------------------------------------------------

Hi Victor,

You are working in the right place. Besides adding a macro for your
view type to view.h, you need to implement the correct operations and
checks in viewray() and viewloc() in image.c. For full support, you
should also look at util/rad.c and insert your view type in some
switch statements therein. Similarly, there is some code you need to
write to split up your view for rpiece in util/rpiece.c.

Can you be more specific when you say that your compilation is not
working? Do you get compile errors, or is something going wrong at
run-time?

Out of curiosity, what type are you adding?

Cheers,
-Greg

* From: goodriver laurus <rioboo at gmail.com <http://www.radiance-online.org/mailman/listinfo/radiance-general>>

*>* Date: October 28, 2016 12:08:09 AM PDT
*> >* Dear all,
*> >* I would like to try a new view type for Radiance. So far I have
included the new type in image.c and included a reference in view.h.
However, the compilation is still not working for rpict. I wonder if
that could be due to the modifications I've made (I have already
corrected a couple of small errors) or because I would need to modify
also other files. Basically, what I am asking is what files should be
considered in order to include an alternative view type for rpict and
vwrays.
*> >* Many thanks,
*> >* Victor Lopez-Rioboo Gil*

Hi Victor,

I'm glad you got this working. I don't know why you are getting a compile error from rad.c. If you defined the VT_EQR type in view.h, that file gets included in rad.c and therefore should be defined. Did you check your spelling?

If pfilt and pcond are missing, it could be because the TIFF library is not compiling properly. Try removing "ra_tiff" and "normtiff" from the targets in src/px/Rmakefile and see if it builds then. I don't know how to fix the TIFF compiles on all systems at this point.

Are you using the equirectangular view to generate HDR texture maps, or ?? It's also relatively straightforward to create such custom views using rcalc and rtrace, without modifying the source. The trouble with modifying the source of course is that you have to do it again with each new release.

Cheers,
-Greg

···

From: Victor LRG <[email protected]>
Date: October 31, 2016 2:08:44 AM PDT

Hi Greg,
Many thanks for that. The view type I am testing is equirectangular (so I've called it VT_EQR). So far I have modified the following:
common/image.c: setview, viewray and viewloc
common/view.h: Macro for new view type.
util/rad.c: specview
util/rpiece.c: same as for VT_ANG

The compilation looked generally ok with makeall, but there is an error in my modification of ray.c:
    rad.c: In function ‘specview’:
    rad.c:1224:7: error: ‘VT_EQR’ undeclared (first use in this function)
It is strange because I could not see any of the other types declared there.
Despite the error, rpict seemed to be working, but other programs were missing (pfilt and pcond at least). I think they were also missing even before changing ray.c, is that possible?
I've made a quick test and the new projection type seems to work. I've rendered a squared view (-vh 120 -vv 60) for the following two scenarios and different view types (VT_PER, VT_ANG, VT_CYL and VT_EQR):
1- From the centre of a checked sphere (meridians and parallels).
2- From the centre of a box with checked walls.
So far it seems to work!, but I haven't tested all options (vo, va, vs, vl...). Is there a standard test to check view types?
I've Included the images below. Hopefully they will display.
cube VT_PER

cube VT_ANG

cube VT_CYL

cube VT_EQR

sphere VT_PER

sphere VT_ANG

sphere VT_CYL

sphere VT_EQR

Cheers,
Victor Lopez-Rioboo Gil
---------------------------------------------------------
Hi Victor,

You are working in the right place. Besides adding a macro for your view type to view.h, you need to implement the correct operations and checks in viewray() and viewloc() in image.c. For full support, you should also look at util/rad.c and insert your view type in some switch statements therein. Similarly, there is some code you need to write to split up your view for rpiece in util/rpiece.c.

Can you be more specific when you say that your compilation is not working? Do you get compile errors, or is something going wrong at run-time?

Out of curiosity, what type are you adding?

Cheers,
-Greg

> From: goodriver laurus <rioboo at gmail.com>
> Date: October 28, 2016 12:08:09 AM PDT
>
> Dear all,
>
> I would like to try a new view type for Radiance. So far I have included the new type in image.c and included a reference in view.h. However, the compilation is still not working for rpict. I wonder if that could be due to the modifications I've made (I have already corrected a couple of small errors) or because I would need to modify also other files. Basically, what I am asking is what files should be considered in order to include an alternative view type for rpict and vwrays.
>
> Many thanks,
>
> Victor Lopez-Rioboo Gil