Jump to content

Mantra rendering


Recommended Posts

@yujiyuji You can Use alpha Like Mask for Glowing in this Case Brightness  .Maybe it Helps :wub: it have Potential :ph34r:+plus you have endless control with wire and points in the code
 

v@Cd = {1,1,1};
@pscale = 0.0007;

___________________________-------_____________________________
if (chs("parm_cam_obj")=="") {
    error("Need a camera object!");
}

     
if (!haspointattrib(0, "pscale")) {
    @pscale = 1.0;
}

if (!haspointattrib(0, "Alpha")) {
    f@Alpha = 1.0;
}


f@pscale *= chf("parm_pre_scale");
vector camPos = cracktransform(0,0,0,{0,0,0},optransform(chs("parm_cam_obj")));

float resx = ch("`chs("parm_cam_obj")`/resx");
float focal = ch("`chs("parm_cam_obj")`/focal");
float filmwidth = ch("`chs("parm_cam_obj")`/aperture");

vector myP = ptransform("space:object","space:world",@P);
float dist_to_cam = abs(length(myP-camPos));
float pixelSize;
if (chi("parm_use_dome_projection")) {  


    pixelSize = (atan(2*@pscale / dist_to_cam) * (resx/2.0));

} else {

    
    pixelSize = ((2*@pscale / dist_to_cam) * ((resx * focal) / filmwidth));

}


if ((pixelSize == 0.0) || (@Alpha == 0.0)) {


    @Alpha = 0.0;
    
} else {
    
    
    float multFac = chf("parm_min_pixels")/pixelSize;

    
    if (chi("parm_visualise")) {
    
        @Cd = {0,1,0};
    
        if (pixelSize < chf("parm_min_pixels")) {
            @Cd = {1,0,0};
        }    
    
    } else {


        if (pixelSize < chf("parm_min_pixels")) {
            
      
        
            @pscale *= multFac;

            if (chi("parm_col_not_alpha")) {
                @Cd /= chi("parm_wires") ? multFac : pow(multFac,2);
            } else {
                @Alpha /= chi("parm_wires") ? multFac : pow(multFac,2);
            }                
        
        } else {
        
    
        
            if (chi("parm_brighten_near_ones")) {
            
             
            
               @pscale *= multFac;
                
                @Cd /= chi("parm_wires") ? multFac : pow(multFac,2);    
                
            }
        }
    }
}
    

 

frdd.jpg

wiree.jpg

Edited by Librarian
  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...