OSL for fulldome

Hi!
I did some experimentation with the OSL for fulldome.



Video:

<span id=“result_box” class="" lang=“en”><span class=“hps”>

Here’s my script OSL.


#include "stdosl.h"
shader simple(
int inv = 0,
float scalex = 0.91, float scaley = 1.00,
float offsetx = 0, float offsety = -0.011,
float warpx = 0.130, float warpy = 0.100,
float rot = 0.000,
vector Vi = 0,
output vector Vo = 0
){
    float x = Vi[0];
    float y = Vi[1];
      
    x = x*scalex+(1-scalex)/2+offsetx;
    y = y*scaley+(1-scaley)/2+offsety;

    x = (0.5-x)*2;
    if(sqrt(x*x+y*y)&gt;1) Vo = vector(2,2,2);
    else {
        float pu = x;
        float pv = y;
        float pr = sqrt(pu*pu+pv*pv);
        float a = atan2(pv,pu);
        float b = pr*M_PI;    
        float py = cos(b);
        float pz = sin(b)*sin(a);
        float px = sin(b)*cos(a);
        float theta = atan2(py,px);
        float phi = atan2(pz,sqrt(px*px+py*py));
        x = (theta + M_PI)/M_2PI + rot + 0.75;
        if(x&gt;1) x=x-1; if(x&lt;0) x=1-x; x=x*(1+warpx)-warpx/2;
        y = phi/M_PI_2; y=y*(1+warpy);
        if(inv) y=1-y;
        if(x&gt;1 | x&lt;0 | y&gt;1 | y&lt;0) Vo = vector(2,2,2);
        else Vo = vector(x,y,0);
    }
}

topic link:
http://paulbourke.net/dome/faq.html
http://paulbourke.net/miscellaneous/littleplanet/

Hi,
That’s pretty cool.

But I’m a bit confused about what do you mean by fulldome here. The final image is using all the field of view of the panorama. which is twice as much what you will need in the fulldome :slight_smile:

Would that be “small planets” instead?
Because even for spherical mirrors (where your FAQ link points too) you will want a fisheye as input image, not the equirectangular panorama.

I’m curious :wink:

???,??????,Supra??????,??? ?????,??? ???? ???,??? ??????,??? ?????,isabel marant ??? ???,??? ??????,??? ????NY???2???1600???,prada ???? ???: ??? ??? ???