mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
small improvments adn exploring the jittering bug for reflections
This commit is contained in:
parent
a07ae70ea0
commit
1b54a29491
3 changed files with 18 additions and 7 deletions
|
@ -55,11 +55,11 @@ Item {
|
|||
property var tick : 0
|
||||
|
||||
function createValues() {
|
||||
print("trigger is: " + JSON.stringify(trigger))
|
||||
// print("trigger is: " + JSON.stringify(trigger))
|
||||
if (Array.isArray(plots)) {
|
||||
for (var i =0; i < plots.length; i++) {
|
||||
var plot = plots[i];
|
||||
print(" a pnew Plot:" + JSON.stringify(plot));
|
||||
// print(" a pnew Plot:" + JSON.stringify(plot));
|
||||
_values.push( {
|
||||
object: (plot["object"] !== undefined ? plot["object"] : root.object),
|
||||
value: plot["prop"],
|
||||
|
@ -73,13 +73,13 @@ Item {
|
|||
})
|
||||
}
|
||||
}
|
||||
print("in creator" + JSON.stringify(_values));
|
||||
// print("in creator" + JSON.stringify(_values));
|
||||
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
createValues();
|
||||
print(JSON.stringify(_values));
|
||||
//print(JSON.stringify(_values));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
//
|
||||
import QtQuick 2.5
|
||||
import QtQuick.Controls 1.4
|
||||
import QtQuick.Layouts 1.1
|
||||
|
||||
import "plotperf"
|
||||
|
||||
Item {
|
||||
|
|
|
@ -90,10 +90,19 @@ vec3 evalSkyboxGlobalColor(mat4 invViewMat, float shadowAttenuation, float obscu
|
|||
color += (1 - metallic) * albedo * evalSphericalLight(getLightAmbientSphere(light), fragNormal).xyz * obscurance * getLightAmbientIntensity(light);
|
||||
|
||||
// Specular highlight from ambient
|
||||
vec3 direction = -reflect(fragEyeDir, fragNormal);
|
||||
//vec3 direction = -reflect(fragEyeDir, fragNormal);
|
||||
// -normalize(position)
|
||||
vec3 direction = -reflect(-normalize(position), normal);
|
||||
// vec3 direction = normal;
|
||||
|
||||
if (gl_FragCoord.x > 1000)
|
||||
return 0.5 * direction + vec3(0.5);
|
||||
// if (gl_FragCoord.x > 1000) {
|
||||
float angleY = fract(asin(direction.y)/ 0.314);
|
||||
float angleX = fract(acos(normalize(direction.xz).x)/ 0.314);
|
||||
float stripeY = step(0.05,abs(angleY));
|
||||
float stripeX = step(0.05,abs(angleX));
|
||||
float grid = max(stripeY, stripeX);
|
||||
return mix( 0.5 * direction + vec3(0.5), mix(vec3(0.0, 1.0, 0.0), vec3(1.0, 0.0, 0.0), stripeY), grid);
|
||||
// }
|
||||
|
||||
float levels = getLightAmbientMapNumMips(light);
|
||||
float lod = min(floor((roughness) * levels), levels);
|
||||
|
|
Loading…
Reference in a new issue