Skip to content

Commit

Permalink
Merge branch 'develop' for v2.42
Browse files Browse the repository at this point in the history
  • Loading branch information
paddywwoof committed Feb 9, 2021
2 parents 87c405a + 8f7c6d8 commit ed720f0
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pi3d/event/FindDevices.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from .Constants import *

def test_bit(nlst, b):
index = b / 32
index = b // 32
bit = b % 32
if len(nlst) <= index:
return False
Expand Down
5 changes: 4 additions & 1 deletion pi3d/shaders/std_bump.inc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

bump.y *= -1.0;
// unib[3][2] ([11] in python) is used to adjust the strength of normal map textures
float bfact = unib[3][2] * (1.0 - smoothstep(100.0, 600.0, dist)); // ------ attenuate smoothly between 100 and 600 units
float bfact = unib[3][2];
if (is_3d > 0.0) {
bfact *= (1.0 - smoothstep(100.0, 600.0, dist)); // ------ attenuate smoothly between 100 and 600 units
}
float intensity = clamp(dot(lightVector, normalize(vec3(0.0, 0.0, 1.0) + bump * bfact)) * lightFactor, 0.0, 1.0); // ------ adjustment of colour according to combined normal
texc.rgb = (texc.rgb * unif[9]) * intensity + (texc.rgb * unif[10]); // ------ directional lightcol * intensity + ambient lightcol
1 change: 1 addition & 0 deletions pi3d/shaders/std_head_fs.inc
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ uniform vec3 unif[20];

varying float dist;
varying float fog_start;
varying float is_3d;

//fragcolor
1 change: 1 addition & 0 deletions pi3d/shaders/std_head_vs.inc
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ uniform vec3 unif[20];

varying float dist;
varying float fog_start;
varying float is_3d;
2 changes: 2 additions & 0 deletions pi3d/shaders/std_main_vs.inc
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@
uvec.y, vvec.y, -normout.y, 0.0,
uvec.z, vvec.z, -normout.z, 0.0,
0.0, 0.0, 0.0, 1.0) * vec4(lightVector, 0.0));

is_3d = abs(modelviewmatrix[0][3][3] - modelviewmatrix[1][3][3]);

0 comments on commit ed720f0

Please sign in to comment.