Changeset 466 for trunk/src/gl/gl_device.cc
- Timestamp:
- 09/04/15 17:46:48 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gl/gl_device.cc
r463 r466 17 17 gl_device::gl_device() 18 18 { 19 m_shader_header.append( "#version 120\n#extension GL_EXT_texture_array : require\n" );19 m_shader_header.append( "#version 330\n" ); 20 20 for ( auto& i : get_uniform_factory() ) 21 21 m_shader_header.append( "uniform "+datatype_to_glsl_type( i.second->get_datatype() )+" "+ i.first +";\n" ); … … 124 124 if ( is_depth ) 125 125 { 126 #define GL_TEXTURE_DEPTH_SIZE 0x884A 127 #define GL_DEPTH_TEXTURE_MODE 0x884B 128 #define GL_TEXTURE_COMPARE_MODE 0x884C 129 #define GL_TEXTURE_COMPARE_FUNC 0x884D 130 #define GL_COMPARE_R_TO_TEXTURE 0x884E 131 132 #define GL_INTENSITY 0x8049 133 #define GL_LUMINANCE 0x1909 134 // glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_R_TO_TEXTURE ); 135 // glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL ); 136 // glTexParameteri( GL_TEXTURE_2D, GL_DEPTH_TEXTURE_MODE, GL_LUMINANCE ); 137 // glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, 0 ); 138 // glTexParameteri( GL_TEXTURE_2D, GL_DEPTH_TEXTURE_MODE, GL_INTENSITY ); 126 glTexParameteri( gl_type, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); 127 glTexParameteri( gl_type, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); 128 129 // This is to allow usage of shadow2DProj function in the shader 130 glTexParameteri( gl_type, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_REF_TO_TEXTURE ); 131 glTexParameteri( gl_type, GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL ); 139 132 } 140 133 … … 182 175 glTexParameteri( gl_type, GL_TEXTURE_WRAP_T, GLint( nv::sampler_wrap_to_enum( asampler.wrap_t ) ) ); 183 176 177 if ( is_depth ) 178 { 179 glTexParameteri( gl_type, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); 180 glTexParameteri( gl_type, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); 181 182 // This is to allow usage of shadow2DProj function in the shader 183 glTexParameteri( gl_type, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_REF_TO_TEXTURE ); 184 glTexParameteri( gl_type, GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL ); 185 } 186 184 187 //glTexStorage3D( GL_TEXTURE_2D_ARRAY, mipLevelCount, GL_RGBA8, width, height, layerCount ); 185 188 glTexImage3D( gl_type, 0, GLint( nv::image_format_to_internal_enum( aformat.format ) ), size.x, size.y, size.z, 0, nv::image_format_to_enum( aformat.format ), nv::datatype_to_gl_enum( aformat.type ), data ); … … 366 369 if ( length > 0 ) 367 370 { 368 NV_LOG_INFO( "Program #", p->glid, " log: ", buffer);371 NV_LOG_INFO( "Program #", p->glid, " log: ", string_view( buffer, size_t( length ) ) ); 369 372 } 370 373
Note: See TracChangeset
for help on using the changeset viewer.