234234 vec3 fresnelBlend ( vec3 n , vec3 refl , vec3 refr )
235235 {
236236 float cos = dot ( n , vec3 ( 0 , 0 , 1 ) ) ;
237- // return refl * (1.0 - cos) + refr * cos;
238- return refl ;
237+ return refl * ( 1.0 - cos ) + refr * cos ;
238+ // return refl;
239239
240240 }
241241
259259
260260 vec4 finalColor = diffuse ;
261261
262+
262263 float a ;
263264 a = alphaControl . r ;
264265 finalColor = finalColor * ( 1.0 - a ) + finalColor * alphaR * a ;
265266 a = alphaControl . g ;
266267 finalColor = finalColor * ( 1.0 - a ) + finalColor * alphaG * a ;
267268 a = alphaControl . b ;
268269 finalColor = finalColor * ( 1.0 - a ) + finalColor * alphaB * a ;
269-
270+
271+
270272 finalColor += vec4 ( specular , 1.0 ) ;
273+
274+
275+ float alpha = diffuse . a ;
276+
277+ a = alphaControl . r ;
278+ alpha = alpha * ( 1.0 - a ) + alpha * alphaR * a ;
279+ a = alphaControl . g ;
280+ alpha = alpha * ( 1.0 - a ) + alpha * alphaG * a ;
281+ a = alphaControl . b ;
282+ alpha = alpha * ( 1.0 - a ) + alpha * alphaB * a ;
271283
272- a = diffuse . a ;
273284
274- finalColor = vec4 ( fresnel * ( 1.0 - a ) + finalColor . rgb * a , 1.0 ) ;
285+ finalColor = vec4 ( fresnel * ( 1.0 - alpha ) + finalColor . rgb * alpha , 1.0 ) ;
275286
276287 if ( mirror == 1 )
277288 {
278289 finalColor = vec4 ( refl , 1.0 ) ;
279290 }
280291
281- a = nn . a ;
292+ a = nn . a ;
282293 vec3 compBackground = backgroundColor * ( 1.0 - a ) + finalColor . rgb * a ;
283294
284295
285296 gl_FragColor = vec4 ( compBackground . rgb , 1.0 ) ;
286- //gl_FragColor = vec4(specular , 1.0);
297+ //gl_FragColor = vec4(diffuse.a,diffuse.a,diffuse.a , 1.0);
287298
288299 //gl_FragColor = vec4(userMouse.x+0.5, -userMouse.y+0.5, 0.0, 1.0);
289300
@@ -495,15 +506,15 @@ <h6>Alpha Image</h6>
495506 Light
496507 </ a >
497508 < div id = "lightControl " class = "inCollapse collapse " >
498- < div class = "checkbox ">
509+ <!-- < div class = "checkbox">
499510 <label>
500511 <span class="h6 inlineBlock" >Show lights Position</span>
501512 <div class = "checkbox_container pull-right">
502513 <input type="checkbox" >
503514 <div class = "pseudoCheckbox"></div>
504515 </div>
505516 </label>
506- </ div >
517+ </div> -->
507518 < div class = "checkbox ">
508519 < label >
509520 < span class ="h6 inlineBlock " > Show Lights Only</ span >
@@ -528,7 +539,7 @@ <h6>Alpha Image</h6>
528539 </ div >
529540 </ li >
530541 <!--Shadow-->
531- < li class ="panel ">
542+ <!-- < li class="panel">
532543 <a class = "myControlTitle collapsed" data-toggle="collapse" data-parent = "#accordion_R" href="#shadow">Shadow<span class="sr-only">(current)</span></a>
533544 <div id = "shadow" class= "inCollapse collapse">
534545 <div class="checkbox">
@@ -559,7 +570,7 @@ <h6>Alpha Image</h6>
559570 </div>
560571 </div>
561572 </div>
562- </ li >
573+ </li> -->
563574 <!--Refraction-->
564575 < li class ="panel ">
565576 < a class ="myControlTitle collapsed " data-toggle ="collapse " data-parent = "#accordion_R " href ="#refractionControl ">
@@ -595,15 +606,15 @@ <h6>Background image</h6>
595606 < input id ="refr_BGdis_slider " data-slider-id ='customSlider ' type ="text " />
596607 </ div >
597608 </ div >
598- < div class ="slider_container ">
609+ <!-- < div class="slider_container">
599610 <span class="h6 inlineBlock"> Translucency </span>
600611 <div class="pull-right">
601612 <input type="text" class="form-control mytextbox text-center" id="translucency_val" value="1">
602613 </div>
603614 <div class="slider_box">
604615 <input id="translucency_slider" data-slider-id='customSlider' type="text"/>
605616 </div>
606- </ div >
617+ </div> -->
607618 </ div >
608619 </ li >
609620 <!--Reflection-->
@@ -659,19 +670,19 @@ <h6>Foreground image</h6>
659670 < input id ="refl_FGdis_slider " data-slider-id ='customSlider ' type ="text " />
660671 </ div >
661672 </ div >
662- < div class ="slider_container ">
673+ <!-- < div class="slider_container">
663674 <span class="h6 inlineBlock"> Bluriness </span>
664675 <div class="pull-right">
665676 <input type="text" class="form-control mytextbox text-center" id="bluriness_val" value="1">
666677 </div>
667678 <div class="slider_box">
668679 <input id="bluriness_slider" data-slider-id='customSlider' type="text"/>
669680 </div>
670- </ div >
681+ </div> -->
671682 </ div >
672683 </ li >
673684 <!--Ambient Occlusion-->
674- < li class ="panel ">
685+ <!-- < li class="panel">
675686 <a class = "myControlTitle collapsed" data-toggle="collapse" data-parent = "#accordion_R" href="#aoControl">
676687 Ambient Occlusion
677688 </a>
@@ -704,9 +715,9 @@ <h6>Foreground image</h6>
704715 </div>
705716 </div>
706717 </div>
707- </ li >
718+ </li> -->
708719 <!--Quality-->
709- < li class ="panel ">
720+ <!-- < li class="panel">
710721 <a class="myControlTitle collapsed" data-toggle="collapse" data-parent = "#accordion_R" href=" #qualityControl">
711722 Quality
712723 </a>
@@ -721,7 +732,7 @@ <h6>Foreground image</h6>
721732 </div>
722733 </div>
723734 </div>
724- </ li >
735+ </li> -->
725736 </ ul >
726737 </ div >
727738 <!--Right column end-->
0 commit comments