Open source, vertex based, UBER shader: V Pipeline (Part 1)

Поделиться
HTML-код
  • Опубликовано: 21 дек 2024

Комментарии • 4

  • @michaeljburt
    @michaeljburt  Месяц назад +6

    UPDATE:
    Almost immediately after posting this, someone very kindly informed me that although GLTF does not directly include UDIM data, you can still shift a UV map by a whole tile outside the 0-1 range, and then use that to map to a predefined color value:
    uniform sampler2D trimsheet;
    const vec3[] colors = {
    vec3(1,0,0),
    vec3(0,1,0)
    };
    void fragment() {
    int color_index = int(floor(UV.x));
    ALBEDO = colors[color_index];
    NORMAL_MAP = texture(trimsheet, UV).rgb;
    }
    Textures still map properly because they repeat!
    I will likely be reworking this for part 2 :)

  • @zuppasoup3757
    @zuppasoup3757 Месяц назад +2

    Thank you very much for the amazing tools ! i gonna check it out later

  • @Flavelius
    @Flavelius Месяц назад

    The problem with these sharp vertex colors is that, even though blender internally doesn't do it in its own mesh model, when exported these create duplicate vertices, and in turn very thin long triangles which are really bad for gpu performance (quad overdraw)

    • @michaeljburt
      @michaeljburt  Месяц назад

      It's a good point. Take a look at the vertex data, it's not duplicated, it's just decoupled from the perspective of indexed drawing. The same thing happens when you shade flat or have split normals. Any of these processes splits up the vertex data in the buffers, and reduces the efficiency of indexed drawing. New and old GPUs can handle this very well, so The Ascent's pipeline just greases the wheels on the CPU/GPU traffic for textures and uniforms. The sharp vertex colors allows the model to be lower poly (some people have smooth shaded models with high poly counts to get around this, which in my opinion is not a trade-off that's worth it).