Creating a checkered ground

Hello! I am kind of new to Cinder and the concepts around it.
I am trying to change the background to white and have a semi transparent ground on the XZ plane. Preferably I would try to have it checkered with 2 different tones of light grey.
How should I approach this?

Thank you for your time,
James

Hey buddy, I’m out on site doing an installation at the moment so I don’t have time to talk you through what this does, but I’ve knocked together a little sample app so you can at least see how one such approach might work. Good luck :slight_smile:

#include "cinder/app/App.h"
#include "cinder/app/RendererGl.h"
#include "cinder/ip/Checkerboard.h"
#include "cinder/CameraUi.h"
#include "cinder/gl/gl.h"

using namespace ci;
using namespace ci::app;

class BasicApp : public App
{
  public:
    void            setup ( ) override;
    void            draw  ( ) override;
    
    gl::BatchRef    _floor;
    CameraPersp     _camera;
    CameraUi        _cameraUi;
    gl::TextureRef  _texture;
};

void prepareSettings( App::Settings * settings )
{
    settings->setWindowSize ( 1280, 720 );
}

void BasicApp::setup ( )
{
    _camera = CameraPersp { getWindowWidth(), getWindowHeight(), 60.0f, 0.1f, 1000.0f };
    _camera.lookAt ( vec3 ( 0, 15, 25 ), vec3 ( 0 ) );
    
    _cameraUi = CameraUi { &_camera, getWindow() };
    _cameraUi.setMinimumPivotDistance ( 0.0f );
    
    auto fmt = gl::Texture::Format().mipmap().minFilter(GL_LINEAR_MIPMAP_LINEAR).magFilter(GL_LINEAR).wrap(GL_REPEAT);
    _texture = gl::Texture::create( ip::checkerboard ( 1024, 1024, 16, Colorf::gray(0.1f), Colorf::gray(0.8f) ), fmt );
    
    auto shader = gl::getStockShader( gl::ShaderDef().color().texture ( _texture ) );
    _floor = gl::Batch::create( geom::Plane().size ( vec2 ( 512 ) ).normal ( vec3 ( 0, 1, 0 ) ), shader );
}

void BasicApp::draw ( )
{
    gl::clear ( Colorf::white() );
    
    {
        gl::setMatrices( _camera );
        gl::ScopedTextureBind tex0 { _texture, 0 };
        gl::ScopedDepth depth { true };
        _floor->draw();
        
        gl::drawCoordinateFrame( 10.0f );
    }
}

CINDER_APP ( BasicApp, RendererGl, prepareSettings )