Jump to content

Shadow and Sun Light Analysis


Recommended Posts

Hi all,

Do you have some ideas how to make Shadow and Sun analysis in H17.5? I would like to make the analytic tool for my procedural city, similar to this: 6121d3ee3961c11877aecbd275eb066a.jpg

I think it would be "sun" vector promoted to objects attributes as color. Maybe some use of new measure node?

Thank you for any advices.

 

Link to comment
Share on other sites

Hi, maybe this approach might work:

int count = npoints(1);

for (int i = 0; i < count; i++)
{

    vector camP = point(1, "P", i);
    vector dir = normalize(camP - @P);
    float bias = 0.01;
    
    vector hit_ps[];
    int hits = intersect_all(0, @P, dir * 100, hit_ps, {}, {});
    if (hits && distance(@P, hit_ps[-1]) > bias)
    // or just check number of intersections:
    // if (  length(hits) >1   )
    {
        @Cd *= 0.6;
    }

}

 

cull.hiplc

cull.PNG

Edited by ikoon
  • Like 5
Link to comment
Share on other sites

  • 2 years later...

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...