fixed speeds
This commit is contained in:
		@ -27,7 +27,7 @@ void main() {
 | 
			
		||||
    int col = int(mod(gl_FragCoord.x, 4));
 | 
			
		||||
    int row = int(mod(gl_FragCoord.y, 4));
 | 
			
		||||
    float threshold = float(bayer16[col + 4 * row]) / 16.0 - 0.5;
 | 
			
		||||
    grey = clamp(grey + threshold * 0.2 , 0.01, 0.99);
 | 
			
		||||
    grey = clamp(grey + threshold * 0.1 , 0.01, 0.99);
 | 
			
		||||
 | 
			
		||||
    vec2 paluv = vec2(grey, 0.5);
 | 
			
		||||
    vec4 paletteValue = texture(texture1, paluv);
 | 
			
		||||
 | 
			
		||||
@ -229,7 +229,7 @@ main :: proc() {
 | 
			
		||||
		look_angles.y -= rl.GetMouseDelta().x * 0.0015
 | 
			
		||||
		look_angles.x += rl.GetMouseDelta().y * 0.0015
 | 
			
		||||
 | 
			
		||||
		SPEED :: 70
 | 
			
		||||
		SPEED :: 40
 | 
			
		||||
		RAD :: 1
 | 
			
		||||
 | 
			
		||||
		moving := false
 | 
			
		||||
@ -249,7 +249,7 @@ main :: proc() {
 | 
			
		||||
			vel.xz += right.xz * delta * SPEED
 | 
			
		||||
			moving = true
 | 
			
		||||
		}
 | 
			
		||||
		vel.xz = rl.Vector2ClampValue(vel.xz, 0, 3)
 | 
			
		||||
		vel.xz = rl.Vector2ClampValue(vel.xz, 0, 5)
 | 
			
		||||
 | 
			
		||||
		if rl.IsKeyDown(.E) do vel.y += delta * SPEED
 | 
			
		||||
		if rl.IsKeyDown(.Q) do vel.y -= delta * SPEED
 | 
			
		||||
@ -266,9 +266,10 @@ main :: proc() {
 | 
			
		||||
		for t in tris {
 | 
			
		||||
			closest := closest_point_on_triangle(cam.position, t[0], t[1], t[2])
 | 
			
		||||
			diff := cam.position - closest
 | 
			
		||||
			diff.xz *= 2
 | 
			
		||||
			dist := linalg.length(diff)
 | 
			
		||||
			normal := diff / dist
 | 
			
		||||
			diff.xz *= 2
 | 
			
		||||
			dist = linalg.length(diff)
 | 
			
		||||
 | 
			
		||||
			rl.DrawCubeV(closest, 0.05, dist > RAD ? rl.ORANGE : rl.WHITE)
 | 
			
		||||
 | 
			
		||||
@ -278,8 +279,8 @@ main :: proc() {
 | 
			
		||||
				vel_normal_dot := linalg.dot(vel, normal)
 | 
			
		||||
				if vel_normal_dot < 0 {
 | 
			
		||||
					vel -= normal * vel_normal_dot
 | 
			
		||||
					if normal.y > 0.5 && !moving {
 | 
			
		||||
						vel.xz *= 0.5
 | 
			
		||||
					if normal.y > 0.6 && !moving {
 | 
			
		||||
						vel.xz = rl.Vector2MoveTowards(vel.xz, {}, 35 * delta)
 | 
			
		||||
						vel.y = 0
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
@ -327,10 +328,10 @@ main :: proc() {
 | 
			
		||||
		rl.EndTextureMode()
 | 
			
		||||
		// rl.BeginDrawing()
 | 
			
		||||
		rl.BeginTextureMode(posttarget)
 | 
			
		||||
		// rl.BeginShaderMode(posterizer)
 | 
			
		||||
		rl.BeginShaderMode(posterizer)
 | 
			
		||||
		rl.SetShaderValueTexture(posterizer, poster_palette, palette)
 | 
			
		||||
		rl.DrawTexture(target.texture, 0, 0, rl.WHITE)
 | 
			
		||||
		// rl.EndShaderMode()
 | 
			
		||||
		rl.EndShaderMode()
 | 
			
		||||
		rl.EndTextureMode()
 | 
			
		||||
 | 
			
		||||
		rl.BeginDrawing()
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user