Honestly not sure if it's a bug or just wrong usage, but it definitely should be handled either at compile time or runtime in one way or another.
Having a return; inside fragment or vertex methods would cause shaders to break, as it would exit before outputs are properly assigned. I'd suggest making it a compile time error if return; statement is used inside entry-point methods.
Honestly not sure if it's a bug or just wrong usage, but it definitely should be handled either at compile time or runtime in one way or another. Having a
return;
insidefragment
orvertex
methods would cause shaders to break, as it would exit before outputs are properly assigned. I'd suggest making it a compile time error ifreturn;
statement is used inside entry-point methods.Source: Haxe#Heaps Discord message by kevansevans
Shader code
```haxe class InfGridShader extends Shader { static var SRC = { @:import h3d.shader.Texture; @param var size:Int = 1; @param var scale:Float = 1; @param var offset_x:Float = 0; @param var offset_y:Float = 0; @param var ratioX:Float = 1; @param var ratioY:Float = 1; function vertex() { calculatedUV = input.uv; } function fragment() { var uvOffset:Vec2 = calculatedUV; var copy:Vec4 = pixelColor; //commenting this out completely breaks it for some reason var alph:Float = min((size * (1 / scale)) / 3, 0.5); if (((uvOffset.x - 0.5) / ratioX) % (size * (1 / scale)) <= 0.01) { pixelColor = vec4(1, 1, 1, 1.0); return; } else if (((uvOffset.y - 0.5) / ratioY) % (size * (1 / scale)) <= 0.01) { pixelColor = vec4(1, 1, 1, 1); return; } } } public function new() { super(); } } ```-D shader_debug_dump
dump: 5_dump.txtProduced fragment shader: