Package fcagnin.jgltut.tut12

Examples of fcagnin.jgltut.tut12.SceneLighting$UnlitProgData


                            Framework.CURRENT_TUTORIAL_DATAPATH = "/fcagnin/jgltut/tut12/data/";
                            new HDRLighting().start( 700, 700 );
                            break;
                        case "Gamma Correction":
                            Framework.CURRENT_TUTORIAL_DATAPATH = "/fcagnin/jgltut/tut12/data/";
                            new GammaCorrection().start( 700, 700 );
                            break;

                        case "BasicImpostor":
                            Framework.CURRENT_TUTORIAL_DATAPATH = "/fcagnin/jgltut/tut13/data/";
                            new BasicImpostor().start();
View Full Code Here


                            Framework.CURRENT_TUTORIAL_DATAPATH = "/fcagnin/jgltut/tut12/data/";
                            new SceneLighting().start( 700, 700 );
                            break;
                        case "HDR Lighting":
                            Framework.CURRENT_TUTORIAL_DATAPATH = "/fcagnin/jgltut/tut12/data/";
                            new HDRLighting().start( 700, 700 );
                            break;
                        case "Gamma Correction":
                            Framework.CURRENT_TUTORIAL_DATAPATH = "/fcagnin/jgltut/tut12/data/";
                            new GammaCorrection().start( 700, 700 );
                            break;
View Full Code Here

        MatrixStack modelMatrix = new MatrixStack();
        modelMatrix.setMatrix( viewPole.calcMatrix() );

        final Mat4 worldToCamMat = modelMatrix.top();
        LightBlock lightData = lights.getLightInformation( worldToCamMat );

        glBindBuffer( GL_UNIFORM_BUFFER, lightUniformBuffer );
        glBufferSubData( GL_UNIFORM_BUFFER, 0, lightData.fillAndFlipBuffer( lightBlockBuffer ) );
        glBindBuffer( GL_UNIFORM_BUFFER, 0 );

        {
            modelMatrix.push();
View Full Code Here

        MatrixStack modelMatrix = new MatrixStack();
        modelMatrix.setMatrix( viewPole.calcMatrix() );

        final Mat4 worldToCamMat = modelMatrix.top();
        LightBlockGamma lightData = lights.getLightInformationGamma( worldToCamMat );
        lightData.gamma = gamma;

        glBindBuffer( GL_UNIFORM_BUFFER, lightUniformBuffer );
        glBufferSubData( GL_UNIFORM_BUFFER, 0, lightData.fillAndFlipBuffer( lightBlockBuffer ) );
        glBindBuffer( GL_UNIFORM_BUFFER, 0 );

        {
            modelMatrix.push();
View Full Code Here

    private boolean drawCameraPos;


    private void setupDaytimeLighting() {
        SunlightValue values[] = {
                new SunlightValue(
                        0.0f / 24.0f,
                        new Vec4( 0.2f, 0.2f, 0.2f, 1.0f ),
                        new Vec4( 0.6f, 0.6f, 0.6f, 1.0f ),
                        new Vec4( skyDaylightColor ) ),
                new SunlightValue(
                        4.5f / 24.0f,
                        new Vec4( 0.2f, 0.2f, 0.2f, 1.0f ),
                        new Vec4( 0.6f, 0.6f, 0.6f, 1.0f ),
                        new Vec4( skyDaylightColor ) ),
                new SunlightValue(
                        6.5f / 24.0f,
                        new Vec4( 0.15f, 0.05f, 0.05f, 1.0f ),
                        new Vec4( 0.3f, 0.1f, 0.10f, 1.0f ),
                        new Vec4( 0.5f, 0.1f, 0.1f, 1.0f ) ),
                new SunlightValue(
                        8.0f / 24.0f,
                        new Vec4( 0.0f, 0.0f, 0.0f, 1.0f ),
                        new Vec4( 0.0f, 0.0f, 0.0f, 1.0f ),
                        new Vec4( 0.0f, 0.0f, 0.0f, 1.0f ) ),
                new SunlightValue(
                        18.0f / 24.0f,
                        new Vec4( 0.0f, 0.0f, 0.0f, 1.0f ),
                        new Vec4( 0.0f, 0.0f, 0.0f, 1.0f ),
                        new Vec4( 0.0f, 0.0f, 0.0f, 1.0f ) ),
                new SunlightValue(
                        19.5f / 24.0f,
                        new Vec4( 0.15f, 0.05f, 0.05f, 1.0f ),
                        new Vec4( 0.3f, 0.1f, 0.1f, 1.0f ),
                        new Vec4( 0.5f, 0.1f, 0.1f, 1.0f ) ),
                new SunlightValue(
                        20.5f / 24.0f,
                        new Vec4( 0.2f, 0.2f, 0.2f, 1.0f ),
                        new Vec4( 0.6f, 0.6f, 0.6f, 1.0f ),
                        new Vec4( skyDaylightColor ) )
        };
View Full Code Here

        lights.setPointLightIntensity( 1, new Vec4( 0.0f, 0.0f, 0.3f, 1.0f ) );
        lights.setPointLightIntensity( 2, new Vec4( 0.3f, 0.0f, 0.0f, 1.0f ) );
    }

    private void setupNighttimeLighting() {
        SunlightValue values[] = {
                new SunlightValue(
                        0.0f / 24.0f,
                        new Vec4( 0.2f, 0.2f, 0.2f, 1.0f ),
                        new Vec4( 0.6f, 0.6f, 0.6f, 1.0f ),
                        new Vec4( skyDaylightColor ) ),
                new SunlightValue(
                        4.5f / 24.0f,
                        new Vec4( 0.2f, 0.2f, 0.2f, 1.0f ),
                        new Vec4( 0.6f, 0.6f, 0.6f, 1.0f ),
                        new Vec4( skyDaylightColor ) ),
                new SunlightValue(
                        6.5f / 24.0f,
                        new Vec4( 0.15f, 0.05f, 0.05f, 1.0f ),
                        new Vec4( 0.3f, 0.1f, 0.10f, 1.0f ),
                        new Vec4( 0.5f, 0.1f, 0.1f, 1.0f ) ),
                new SunlightValue(
                        8.0f / 24.0f,
                        new Vec4( 0.0f, 0.0f, 0.0f, 1.0f ),
                        new Vec4( 0.0f, 0.0f, 0.0f, 1.0f ),
                        new Vec4( 0.0f, 0.0f, 0.0f, 1.0f ) ),
                new SunlightValue(
                        18.0f / 24.0f,
                        new Vec4( 0.0f, 0.0f, 0.0f, 1.0f ),
                        new Vec4( 0.0f, 0.0f, 0.0f, 1.0f ),
                        new Vec4( 0.0f, 0.0f, 0.0f, 1.0f ) ),
                new SunlightValue(
                        19.5f / 24.0f,
                        new Vec4( 0.15f, 0.05f, 0.05f, 1.0f ),
                        new Vec4( 0.3f, 0.1f, 0.1f, 1.0f ),
                        new Vec4( 0.5f, 0.1f, 0.1f, 1.0f ) ),
                new SunlightValue(
                        20.5f / 24.0f,
                        new Vec4( 0.2f, 0.2f, 0.2f, 1.0f ),
                        new Vec4( 0.6f, 0.6f, 0.6f, 1.0f ),
                        new Vec4( skyDaylightColor ) )
        };
View Full Code Here

    private float gammaValue = 2.2f;


    private void setupHDRLighting() {
        SunlightValueHDR values[] = {
                new SunlightValueHDR(
                        0.0f / 24.0f,
                        new Vec4( 0.6f, 0.6f, 0.6f, 1.0f ),
                        new Vec4( 1.8f, 1.8f, 1.8f, 1.0f ),
                        new Vec4( skyDaylightColor ),
                        3.0f ),
                new SunlightValueHDR(
                        4.5f / 24.0f,
                        new Vec4( 0.6f, 0.6f, 0.6f, 1.0f ),
                        new Vec4( 1.8f, 1.8f, 1.8f, 1.0f ),
                        new Vec4( skyDaylightColor ),
                        3.0f ),
                new SunlightValueHDR(
                        6.5f / 24.0f,
                        new Vec4( 0.225f, 0.075f, 0.075f, 1.0f ),
                        new Vec4( 0.45f, 0.15f, 0.15f, 1.0f ),
                        new Vec4( 0.5f, 0.1f, 0.1f, 1.0f ),
                        1.5f ),
                new SunlightValueHDR(
                        8.0f / 24.0f,
                        new Vec4( 0.0f, 0.0f, 0.0f, 1.0f ),
                        new Vec4( 0.0f, 0.0f, 0.0f, 1.0f ),
                        new Vec4( 0.0f, 0.0f, 0.0f, 1.0f ),
                        1.0f ),
                new SunlightValueHDR(
                        18.0f / 24.0f,
                        new Vec4( 0.0f, 0.0f, 0.0f, 1.0f ),
                        new Vec4( 0.0f, 0.0f, 0.0f, 1.0f ),
                        new Vec4( 0.0f, 0.0f, 0.0f, 1.0f ),
                        1.0f ),
                new SunlightValueHDR(
                        19.5f / 24.0f,
                        new Vec4( 0.225f, 0.075f, 0.075f, 1.0f ),
                        new Vec4( 0.45f, 0.15f, 0.15f, 1.0f ),
                        new Vec4( 0.5f, 0.1f, 0.1f, 1.0f ),
                        1.5f ),
                new SunlightValueHDR(
                        20.5f / 24.0f,
                        new Vec4( 0.6f, 0.6f, 0.6f, 1.0f ),
                        new Vec4( 1.8f, 1.8f, 1.8f, 1.0f ),
                        new Vec4( skyDaylightColor ),
                        3.0f ),
View Full Code Here

    private void setupGammaLighting() {
        Vec4 sunlight = new Vec4( 6.5f, 6.5f, 6.5f, 1.0f );
        Vec4 brightAmbient = new Vec4( 0.4f, 0.4f, 0.4f, 1.0f );

        SunlightValueHDR values[] = {
                new SunlightValueHDR(
                        0.0f / 24.0f,
                        brightAmbient,
                        sunlight,
                        new Vec4( 0.65f, 0.65f, 1.0f, 1.0f ),
                        10.0f ),
                new SunlightValueHDR(
                        4.5f / 24.0f,
                        brightAmbient,
                        sunlight,
                        new Vec4( skyDaylightColor ),
                        10.0f ),
                new SunlightValueHDR(
                        6.5f / 24.0f,
                        new Vec4( 0.01f, 0.025f, 0.025f, 1.0f ),
                        new Vec4( 2.5f, 0.2f, 0.2f, 1.0f ),
                        new Vec4( 0.5f, 0.1f, 0.1f, 1.0f ),
                        5.0f ),
                new SunlightValueHDR(
                        8.0f / 24.0f,
                        new Vec4( 0.0f, 0.0f, 0.0f, 1.0f ),
                        new Vec4( 0.0f, 0.0f, 0.0f, 1.0f ),
                        new Vec4( 0.0f, 0.0f, 0.0f, 1.0f ),
                        3.0f ),
                new SunlightValueHDR(
                        18.0f / 24.0f,
                        new Vec4( 0.0f, 0.0f, 0.0f, 1.0f ),
                        new Vec4( 0.0f, 0.0f, 0.0f, 1.0f ),
                        new Vec4( 0.0f, 0.0f, 0.0f, 1.0f ),
                        3.0f ),
                new SunlightValueHDR(
                        19.5f / 24.0f,
                        new Vec4( 0.01f, 0.025f, 0.025f, 1.0f ),
                        new Vec4( 2.5f, 0.2f, 0.2f, 1.0f ),
                        new Vec4( 0.5f, 0.1f, 0.1f, 1.0f ),
                        5.0f ),
                new SunlightValueHDR(
                        20.5f / 24.0f,
                        brightAmbient,
                        sunlight,
                        new Vec4( skyDaylightColor ),
                        10.0f )
View Full Code Here

    private FloatBuffer lightBlockBuffer = BufferUtils.createFloatBuffer( LightBlock.SIZE );


    private void initializePrograms() {
        for ( int progIndex = 0; progIndex < LightingProgramTypes.MAX_LIGHTING_PROGRAM_TYPES.ordinal(); progIndex++ ) {
            programs[progIndex] = new ProgramData();
            programs[progIndex] = loadLitProgram( shaderFileNames[progIndex].vertexShaderFileName,
                    shaderFileNames[progIndex].fragmentShaderFileName );
        }

        unlit = loadUnlitProgram( "PosTransform.vert", "UniformColor.frag" );
View Full Code Here

    private ProgramData loadLitProgram(String vertexShaderFileName, String fragmentShaderFileName) {
        ArrayList<Integer> shaderList = new ArrayList<>();
        shaderList.add( Framework.loadShader( GL_VERTEX_SHADER, vertexShaderFileName ) );
        shaderList.add( Framework.loadShader( GL_FRAGMENT_SHADER, fragmentShaderFileName ) );

        ProgramData data = new ProgramData();
        data.theProgram = Framework.createProgram( shaderList );
        data.modelToCameraMatrixUnif = glGetUniformLocation( data.theProgram, "modelToCameraMatrix" );

        data.normalModelToCameraMatrixUnif = glGetUniformLocation( data.theProgram, "normalModelToCameraMatrix" );
View Full Code Here

TOP

Related Classes of fcagnin.jgltut.tut12.SceneLighting$UnlitProgData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.