# Shader with perfect lambertian angle-dependent specularity, can it be made in GroIMP?

**URL:** <https://fspm.discourse.group/t/shader-with-perfect-lambertian-angle-dependent-specularity-can-it-be-made-in-groimp/317>\
**Category:** Physical Environment\
**Created:** [October 29, 2024, 8:16am UTC](https://fspm.discourse.group/t/shader-with-perfect-lambertian-angle-dependent-specularity-can-it-be-made-in-groimp/317 "2024-10-29T08:16:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Euwnt9](https://avatars.discourse-cdn.com/v4/letter/e/839c29/32.png) [@Euwnt9](https://fspm.discourse.group/u/Euwnt9)\
**Post date:** [October 29, 2024, 8:16am UTC](https://fspm.discourse.group/t/shader-with-perfect-lambertian-angle-dependent-specularity-can-it-be-made-in-groimp/317/1 "2024-10-29T08:16:57Z")

</div>

Dear all,

I am looking into light transmission through objects. By default, the setDiffuseTransparency of a shader will assume a lambertian scattering (i.e. ignoring angle of incidence of light). Though GroIMP does not do it perfectly, as lambertian scattering should have light equally scattered in all directions ([Living Textbook | Home | By ITC, University of Twente](https://ltb.itc.utwente.nl/page/671/concept/124163)). My model simulations shows this is not the case (see picture).

 ![3D_plot_top_angle](https://europe1.discourse-cdn.com/flex005/uploads/fspm/original/1X/bf2b5029962d71adfe9d6639966211fb9f3afd28.png)

What I want is to be able to have a perfect lambertian transmission through a greenhouse roof (defined by e.g. parallelograms). Does anybody know how to change the shader such that a perfect lambertian scattering is achieved?

Then there is a second point, the angle of incidence also reduces transmission due to shifting specularity values ([Specular reflection - Wikipedia](https://en.wikipedia.org/wiki/Specular_reflection)). Does anybody know how to set the properties of a shader to be angle dependent?

I couldn’t solve it myself by looking at the documentation, so I hope somebody else has experience.

Cheers,  
Maarten

---

<div class="post-metadata">

**Author:** ![Euwnt9](https://avatars.discourse-cdn.com/v4/letter/e/839c29/32.png) [@Euwnt9](https://fspm.discourse.group/u/Euwnt9)\
**Post date:** [October 31, 2024, 5:49am UTC](https://fspm.discourse.group/t/shader-with-perfect-lambertian-angle-dependent-specularity-can-it-be-made-in-groimp/317/2 "2024-10-31T05:49:35Z")

</div>

As I cannot use the edit function anymore, I will post it here. The pattern that I see in absorbed light actually does match [Lambert’s cosine law - Wikipedia](https://en.wikipedia.org/wiki/Lambert%27s_cosine_law). So it is a Lambertian diffuser after all.

Part 2 of the original question I still do not know how to achieve. For an LED light for example you have the azimuthal and elevation angle’s to describe the emission pattern. I would like the same to be possible for applied shaders. Different greenhouse cover materials have different patterns due to coatings/structure of the glass.

Cheers,  
Maarten
