Ejemplo n.º 1
0
DisplacementPatchSampler::DisplacementPatchSampler(const GeometryImage & detailedGeometryMap, const BitMap & detailedGeometryMask, GeometryImage & geometryMap, BitMap & geometryMask) :
	m_detailedGeometryMap(detailedGeometryMap), 
	m_detailedGeometryMask(detailedGeometryMask),
	m_geometryMap(geometryMap), 
	m_geometryMask(geometryMask)
{
	nvCheck(geometryMap.width() == geometryMask.width());
	nvCheck(geometryMap.height() == geometryMask.height());
}
Ejemplo n.º 2
0
Texture::Texture(const BitMap& bitmap, GLint minMagFilter,GLint wrapMode): _orgWidth((GLfloat)bitmap.width()), _orgHeight((GLfloat)bitmap.height()){
	glGenTextures(1, &_object);
	glBindTexture(GL_TEXTURE_2D, _object);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,minMagFilter);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER,minMagFilter);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S,wrapMode);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T,wrapMode);
	glTexImage2D(GL_TEXTURE_2D, 0,
		textureFormatforBitmap(bitmap.format(),true), 
		(GLsizei)bitmap.width(), 
		(GLsizei)bitmap.height(), 
		0,
		textureFormatforBitmap(bitmap.format(),false), 
		GL_UNSIGNED_BYTE,
		bitmap.pixelBuffer());
	glGenerateMipmap(GL_TEXTURE_2D);
	glBindTexture(GL_TEXTURE_2D,0);

}
Ejemplo n.º 3
0
GeometrySampler::GeometrySampler(GeometryImage & image, BitMap & imageMask) : m_image(image), m_imageMask(imageMask)
{
	nvCheck(image.width() == imageMask.width());
	nvCheck(image.height() == imageMask.height());
}