Skip to content
Snippets Groups Projects
Commit 7dbacd9f authored by Michael Heyde's avatar Michael Heyde
Browse files

validated bling phong

parent 16366aae
No related branches found
No related tags found
No related merge requests found
......@@ -76,9 +76,11 @@ public class IsoSurfaceVolumeInterpreter extends AbstractVolumeInterpreter {
" vec3 lightDirs,",
" vec3 iIn){",
" vec3 halfVec = (lightDirs+lookVector)/length(lightDirs+lookVector);",
" float ln = dot(lightDirs, normal);",
" float v =max (sign(ln),0.0);",
" vec3 iOut = constants.x * iAmbient;//ambient",
" iOut += iIn*(constants.y*abs(dot(lightDirs, normal)));//diffuse",
" iOut += iIn*(constants.z*pow( abs(dot(halfVec,normal)),10.0));//specular",
" iOut += iIn*(constants.y*max(ln,0.0));//diffuse",
" iOut += v*iIn*(constants.z*max(pow( dot(halfVec,normal),10.0),0.0));//specular",
" ",
" return iOut;",
"}",
......@@ -106,7 +108,7 @@ public class IsoSurfaceVolumeInterpreter extends AbstractVolumeInterpreter {
" vec4 gradient = "+gradEval.call(new String[]{"refinedVal.xyz"})+";",
" color.rgb = blinnPhongShading( inconstants,",
" ambientColor/*c.rgb*/,",
" normalize(gradient.xyz),",
" -normalize(gradient.xyz),",
" -1.0 * "+sgvRayDirections+",",
" normalize( "+suvEyePosition+" - "+sgvRayPositions+"),",
" "+suvLightIntensiy+");",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment