Пример #1
0
        result = vec4(samp, 1.0);
    }

    """ 

    target['color'].set_minfilter(Texture.FT_nearest)
    target['color'].set_magfilter(Texture.FT_nearest)
    target['color'].set_wrap_u(Texture.WM_border_color)
    target['color'].set_wrap_v(Texture.WM_border_color)
    target['color'].set_border_color(Vec4(1,0, 0, 1))

    target.set_shader(Shader.make(Shader.SLGLSL, vertex_shader, fragment_shader))
    target_stitch.set_shader(Shader.make(Shader.SLGLSL, vertex_shader, stitch_frag))

    target_stitch.set_shader_input("SourceTex", target["color"])

    base.graphicsEngine.render_frame()

    k = target_stitch['color']
    base.graphicsEngine.extractTextureData(k, base.win.get_gsg())

    p = PNMImage()
    k.store(p)
    p.set_num_channels(1)

    p.write("NormalQuantizationTex-" + str(mip) + ".png")
    mip += 1
    TEXTURE_SIZE //= 2