Empty Compiler_Result when compiling test file #3

Closed
opened 2025-08-23 21:04:03 +00:00 by danielbross · 0 comments
Collaborator

Getting the following result when compiling the night_time shader:

Shader compilation result: {[], false, [], {null, null}, {null}}

Shader code

p :: properties {
	input_tex : Texture2D;
	tex_sampler : Sampler;

	hour_of_day : float;
}

VS_Input :: struct {
	pos : float3 @position;
	uv  : float2 @uv;
}

VS_Output :: struct {
	pos : float4 @outposition;
	uv  : float2 @uv;
}

vertex main :: (input : VS_Input) -> VS_Output {
	output : VS_Output;
	output.pos = float4(input.pos, 1.0);
	output.uv  = input.uv;
	return output;
}

apply_night :: (color : float4) -> float4 {
	result := color;
	result -= float4(0.3, 0.2, 0.0, 0.0);
	result *= 0.8;

	return result;
}

apply_twilight :: (color : float4) -> float4 {
	result := color;
	result += float4(0.2, -0.1, 0.1, 0.0);
	result *= 0.9;

	return result;
}

apply_morning :: (color : float4) -> float4 {
	return color * 1.3;
}

apply_dawn :: (color : float4) -> float4 {
	return color;
}

pixel main :: (input : VS_Output) -> float4 @outposition {
	sampled_color : float4 = sample(p.input_tex, p.tex_sampler, input.uv);

	t := 0.0;
	a := float4(0, 0, 0, 0);
	b := float4(0, 0, 0, 0);

	if p.hour_of_day > 16 {
        t = (p.hour_of_day - 16) / 6;
        a = apply_twilight(sampled_color);
        b = apply_night(sampled_color);
    } else if p.hour_of_day > 12 {
        t = (p.hour_of_day - 12) / 6;
        a = sampled_color;
        b = apply_twilight(sampled_color);
    } else if p.hour_of_day > 6 {
        t = (p.hour_of_day - 6) / 6;
        a = apply_morning(sampled_color);
        b = sampled_color;
    } else if p.hour_of_day >= 0 {
        t = p.hour_of_day / 6;
        a = apply_night(sampled_color);
        b = apply_morning(sampled_color);
    }

	return lerp(a, b, t);
}
Getting the following result when compiling the night_time shader: `Shader compilation result: {[], false, [], {null, null}, {null}}` Shader code ``` p :: properties { input_tex : Texture2D; tex_sampler : Sampler; hour_of_day : float; } VS_Input :: struct { pos : float3 @position; uv : float2 @uv; } VS_Output :: struct { pos : float4 @outposition; uv : float2 @uv; } vertex main :: (input : VS_Input) -> VS_Output { output : VS_Output; output.pos = float4(input.pos, 1.0); output.uv = input.uv; return output; } apply_night :: (color : float4) -> float4 { result := color; result -= float4(0.3, 0.2, 0.0, 0.0); result *= 0.8; return result; } apply_twilight :: (color : float4) -> float4 { result := color; result += float4(0.2, -0.1, 0.1, 0.0); result *= 0.9; return result; } apply_morning :: (color : float4) -> float4 { return color * 1.3; } apply_dawn :: (color : float4) -> float4 { return color; } pixel main :: (input : VS_Output) -> float4 @outposition { sampled_color : float4 = sample(p.input_tex, p.tex_sampler, input.uv); t := 0.0; a := float4(0, 0, 0, 0); b := float4(0, 0, 0, 0); if p.hour_of_day > 16 { t = (p.hour_of_day - 16) / 6; a = apply_twilight(sampled_color); b = apply_night(sampled_color); } else if p.hour_of_day > 12 { t = (p.hour_of_day - 12) / 6; a = sampled_color; b = apply_twilight(sampled_color); } else if p.hour_of_day > 6 { t = (p.hour_of_day - 6) / 6; a = apply_morning(sampled_color); b = sampled_color; } else if p.hour_of_day >= 0 { t = p.hour_of_day / 6; a = apply_night(sampled_color); b = apply_morning(sampled_color); } return lerp(a, b, t); } ```
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: nielsbross/Ink-Shader-Language#3
No description provided.