Jump to content
Sign in to follow this  
yujiyuji

Mantra rendering

Recommended Posts

I have now created something like the image attached here.
Now all the lines are glowing.
Is it possible to make only certain places glow with noise in the rendering just using Mantra?
Other places are fine to leave dark lines.

Someone please advise.

Sample3.PNG

Share this post


Link to post
Share on other sites

@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

Share this post


Link to post
Share on other sites
59 minutes ago, konstantin magnus said:

You could simply bind export color-ramped noise as color emission (Ce).

glow_lines.thumb.jpg.3d36ea9e3aac121d7cc677723ff74bfe.jpg

glow_lines.hipnc

Wow!

I's really easy to understand!!

Thank you!!

Share this post


Link to post
Share on other sites

@yujiyuji I use Abs Everything From this Topic and  1 exampel  just copy paste code into att wrangle. and Have Some Camera in you Scene.Have Fun Combine Stuff
 

de.jpg

de5.jpg

de55.jpg

  • Thanks 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×