squared distance function
This commit is contained in:
@@ -100,12 +100,23 @@ vec3 Pruefe_Pixel_in_Umgebung (vec2 start){
|
||||
}else{
|
||||
return vec3(0.5f);
|
||||
}*/
|
||||
float nenner=0.0f;
|
||||
i=0;
|
||||
while(i<anzahl_richtungen){
|
||||
if(SicheresPixel[i].w!=-1){
|
||||
SicheresPixel[i].w=pow(maximal-SicheresPixel[i].w,2);
|
||||
nenner+=SicheresPixel[i].w;
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
i=0;
|
||||
vec3 kombiniert=vec3(0.0f);
|
||||
float nenner=gefundene_pixel*maximal-gesamt_abstand;
|
||||
|
||||
while(i<anzahl_richtungen){
|
||||
if(SicheresPixel[i].w!=-1)
|
||||
kombiniert+=SicheresPixel[i].xyz*(maximal-SicheresPixel[i].w)/nenner;
|
||||
kombiniert+=SicheresPixel[i].xyz*SicheresPixel[i].w/nenner;
|
||||
i++;
|
||||
}
|
||||
return kombiniert;
|
||||
@@ -130,7 +141,7 @@ void main(){
|
||||
color = getBackColor(UV).rgb;
|
||||
} else {
|
||||
vec3 h=Pruefe_Pixel_in_Umgebung(UV);
|
||||
//h=vec3(0.5f);
|
||||
//h=vec3(1.0f, 0.0f,0f);
|
||||
color = h;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user