Skip to main content
Fix copy-paste markup error
Source Link
Peter Taylor
  • 43.1k
  • 4
  • 70
  • 169

I know I'm a late to this discussion but I thought I would post my attempt to this thread just in case it is useful/interesting to anyone.

GLSL

vec3 xy2rgb3( in vec2 pos ) {<br>
    vec2 rc = pos * 8.0;<br>0;
    vec2 mp = fract( rc );<br>;
    rc = (rc - mp) * 0.125;<br>125;
    return vec3( (rc.y * 0.125) + rc.x, mp );<br>;
}

The live editable version can be found here xy2rgb3/rgb3toxy2.

enter image description here

I know I'm a late to this discussion but I thought I would post my attempt to this thread just in case it is useful/interesting to anyone.

GLSL

vec3 xy2rgb3( in vec2 pos ) {<br>
    vec2 rc = pos * 8.0;<br>
    vec2 mp = fract( rc );<br>
    rc = (rc - mp) * 0.125;<br>
    return vec3( (rc.y * 0.125) + rc.x, mp );<br>
}

The live editable version can be found here xy2rgb3/rgb3toxy2.

enter image description here

I know I'm a late to this discussion but I thought I would post my attempt to this thread just in case it is useful/interesting to anyone.

GLSL

vec3 xy2rgb3( in vec2 pos ) {
    vec2 rc = pos * 8.0;
    vec2 mp = fract( rc );
    rc = (rc - mp) * 0.125;
    return vec3( (rc.y * 0.125) + rc.x, mp );
}

The live editable version can be found here xy2rgb3/rgb3toxy2.

enter image description here

Code snippet formatry
Source Link
SuperJedi224
  • 12k
  • 1
  • 45
  • 68

I know I'm a late to this discussion but I thought I would post my attempt to this thread just in case it is useful/interesting to anyone.

GLSL

vec3 xy2rgb3( in vec2 pos ) {
vec2 rc = pos * 8.0;
vec2 mp = fract( rc );
rc = (rc - mp) * 0.125;
return vec3( (rc.y * 0.125) + rc.x, mp );
}

vec3 xy2rgb3( in vec2 pos ) {<br>
    vec2 rc = pos * 8.0;<br>
    vec2 mp = fract( rc );<br>
    rc = (rc - mp) * 0.125;<br>
    return vec3( (rc.y * 0.125) + rc.x, mp );<br>
}

The live editable version can be found here xy2rgb3/rgb3toxy2.

enter image description here

I know I'm a late to this discussion but I thought I would post my attempt to this thread just in case it is useful/interesting to anyone.

GLSL

vec3 xy2rgb3( in vec2 pos ) {
vec2 rc = pos * 8.0;
vec2 mp = fract( rc );
rc = (rc - mp) * 0.125;
return vec3( (rc.y * 0.125) + rc.x, mp );
}

The live editable version can be found here xy2rgb3/rgb3toxy2.

enter image description here

I know I'm a late to this discussion but I thought I would post my attempt to this thread just in case it is useful/interesting to anyone.

GLSL

vec3 xy2rgb3( in vec2 pos ) {<br>
    vec2 rc = pos * 8.0;<br>
    vec2 mp = fract( rc );<br>
    rc = (rc - mp) * 0.125;<br>
    return vec3( (rc.y * 0.125) + rc.x, mp );<br>
}

The live editable version can be found here xy2rgb3/rgb3toxy2.

enter image description here

Source Link

I know I'm a late to this discussion but I thought I would post my attempt to this thread just in case it is useful/interesting to anyone.

GLSL

vec3 xy2rgb3( in vec2 pos ) {
vec2 rc = pos * 8.0;
vec2 mp = fract( rc );
rc = (rc - mp) * 0.125;
return vec3( (rc.y * 0.125) + rc.x, mp );
}

The live editable version can be found here xy2rgb3/rgb3toxy2.

enter image description here