Changeset 5394


Ignore:
Timestamp:
May 2, 2015, 2:31:12 AM (9 years ago)
Author:
ldelgass
Message:

Merge r3875:3876 from trunk, update mergeinfo

Location:
nanovis/branches/1.2
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • nanovis/branches/1.2

  • nanovis/branches/1.2/Makefile.in

    r5047 r5394  
    312312RegularVolumeShader.o: RegularVolumeShader.cpp RegularVolumeShader.h VolumeShader.h Shader.h
    313313RenderVertexArray.o: RenderVertexArray.cpp RenderVertexArray.h
    314 Shader.o: Shader.cpp Shader.h
     314Shader.o: Shader.cpp Shader.h config.h
    315315StdVertexShader.o: StdVertexShader.cpp StdVertexShader.h Shader.h
    316316Switch.o: Switch.cpp Switch.h
  • nanovis/branches/1.2/Shader.cpp

    r4904 r5394  
    1212#include <util/FilePath.h>
    1313
     14#include "config.h"
    1415#include "Shader.h"
    1516#include "Trace.h"
     
    1819using namespace nv::util;
    1920
     21/**
     22 * These correspond to NV_vertex_program3 and NV_fragment_program2:
     23 * CG_PROFILE_VP40
     24 * CG_PROFILE_FP40
     25 *
     26 * These correspond to ARB_vertex_program and ARB_fragment_program:
     27 * CG_PROFILE_ARBVP1
     28 * CG_PROFILE_ARBFP1
     29 *
     30 * Generic GLSL targets:
     31 * CG_PROFILE_GLSLV
     32 * CG_PROFILE_GLSLF
     33 */
     34#ifdef USE_ARB_PROGRAMS
     35CGprofile Shader::_defaultVertexProfile = CG_PROFILE_ARBVP1;
     36CGprofile Shader::_defaultFragmentProfile = CG_PROFILE_ARBFP1;
     37#else
    2038CGprofile Shader::_defaultVertexProfile = CG_PROFILE_VP40;
    2139CGprofile Shader::_defaultFragmentProfile = CG_PROFILE_FP40;
     40#endif
    2241CGcontext Shader::_cgContext = NULL;
    2342
  • nanovis/branches/1.2/VelocityArrowsSlice.cpp

    r4904 r5394  
    6363    _queryVelocityFP.loadFragmentProgram("queryvelocity.cg");
    6464
    65     _particleShader.loadVertexProgram("velocityslicevp.cg");
    66     _particleShader.loadFragmentProgram("velocityslicefp.cg");
     65    // Delay loading of shaders only required for glyph style rendering
     66    if (_renderMode == GLYPHS) {
     67        _particleShader.loadVertexProgram("velocityslicevp.cg");
     68        _particleShader.loadFragmentProgram("velocityslicefp.cg");
     69    }
    6770
    6871    createRenderTarget();
     
    412415        glTexEnvi(GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, GL_TRUE);
    413416
     417        // FIXME: This vertex shader won't compile with ARB_vertex_program,
     418        // so it should use GLSL
     419        if (!_particleShader.isVertexProgramLoaded()) {
     420            _particleShader.loadVertexProgram("velocityslicevp.cg");
     421        }
     422        if (!_particleShader.isFragmentProgramLoaded()) {
     423            _particleShader.loadFragmentProgram("velocityslicefp.cg");
     424        }
     425
    414426        _particleShader.bind();
    415427        _particleShader.setVPTextureParameter("vfield", _vectorFieldGraphicsID);
  • nanovis/branches/1.2/config.h

    r4874 r5394  
    3838
    3939/*
     40 * If defined, use ARB_vertex_program and ARB_fragment_program as Cg
     41 * profile target, otherwise NV_vertex_program3 and NV_fragment_program2
     42 * are required
     43 */
     44//#define USE_ARB_PROGRAMS
     45
     46/*
    4047 * Keep statistics
    4148 */
  • nanovis/branches/1.2/nanovis.cpp

    r4937 r5394  
    518518    }
    519519#endif
    520     // FIXME: should use ARB programs or (preferably) a GLSL profile for portability
     520    // FIXME: should use GLSL for portability
     521#ifdef USE_ARB_PROGRAMS
     522    if (!GLEW_ARB_vertex_program ||
     523        !GLEW_ARB_fragment_program) {
     524        ERROR("ARB_vertex_program and ARB_fragment_program extensions are required");
     525        return false;
     526    }
     527#else
    521528    if (!GLEW_NV_vertex_program3 ||
    522529        !GLEW_NV_fragment_program2) {
     
    524531        return false;
    525532    }
     533#endif
    526534
    527535    if (!FilePath::getInstance()->setPath(path)) {
Note: See TracChangeset for help on using the changeset viewer.