Looking for someone to develop a Glitter shader effect

i work on nme that can support more color but for shaderbuilder version
https://www.babylonjs-playground.com/#7AIII8#75
https://www.babylonjs-playground.com/#7AIII8#76
change color 1 and color 2 (gold and reality white gold )

4 Likes

Thank you very much @nasimiasl !! You helped me a lot :heart_eyes:

1 Like

This may be of interest: Beautiful Glitter Simulation…Faster Than Real Time! ✨ - YouTube

2 Likes

Hi @nasimiasl is there a NME version of the glitter effect along with the PBR?

hey @paint_renderer i am more happy with coding and more time dont use NME but if other member cant help you i try do it in next day

1 Like

Hi, Could someone point to the resources I will need to recreate the flakes within babylon PBR material, I do not want to use shaders at this point.

Also can you please let me know why you used the mathematical form you did in your reflect function?

maybe that help

this is parametrise reflect base without transform matris

/* that is for chose flat or default normal */   
vec3 new_nrm =  nrm;  

/*
 that make reflect base UV without Transform Matris for read 360 Enviroment Texture 
 you can control  reflect effect base on scale and breake parameters  */ 
  vec3 vr = normalize( refract(  normalize(camera -pos*3.141592*length(camera- pos)* 
                scale)   ,  new_nrm ,    /*break light */ );  

/* this calculation change the reflect xyz to UV  */
  float y = .5  -  atan(   Z * vr.z,    X*vr x ) / (2.*3.141592); 

  float p = 0.5  - atan(Y * vr.y ,  length( vr.xz ) ) / ( 3.141592);  

   result = texture(  reflectReference , vec2 ( y , p ) ,   bias  );
                

you can see the effect of reflect 1

and reflect 2

then just apply noise and colors

the final part use Effect

/*. pr  = > x = f(x) y = f(y) z = f(z) 
px = > x= f(x) 
py = > y= f(y)
pz = > z= f(z)

   x =  pow(x,2.)*1.5+pow(x,0.5)*0.25+ns2*z*0.3;
   y =  pow(y,2.)*1.5+pow(y,0.5)*0.25+ns2*z*0.3;
   z =  pow(z,2.)*1.5+pow(z,0.5)*0.25+ns2*z*0.3; 

 */
 .Effect({   pr:'pow(pr,2.)*1.5+pow(pr,0.5)*0.25+ns2*pz*0.3'})

reflect 1 only use for transparent material

aftter add effect

.Effect({pr:’ pow(pr,3.)+pow(pr,13.)*0.5+0.3 '}) // i think we need make event funcion in NME first

4 Likes