[Radiance-general] Creating new view types for Radiance

Greg Ward gregoryjward at gmail.com
Mon Oct 31 10:38:13 PDT 2016


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 <rioboo at gmail.com>
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.radiance-online.org/pipermail/radiance-general/attachments/20161031/58393c8f/attachment.html>


More information about the Radiance-general mailing list