git-svn-id: svn://db.shs.com.ru/libs@701 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -88,6 +88,7 @@ Map::Map() {
|
||||
color_amount = 1.f;
|
||||
color_offset = 0.f;
|
||||
bitmap_scale = QPointF(1., 1.);
|
||||
use_bitmap = false;
|
||||
_changed = true;
|
||||
_layer = 0;
|
||||
}
|
||||
@@ -109,7 +110,7 @@ void Map::copyToQGLMap(QGLMap & m) const {
|
||||
m.amount = color_amount;
|
||||
m.offset = color_offset;
|
||||
m.scale = QVector2D(bitmap_scale);
|
||||
if (hasBitmap()) {
|
||||
if (hasBitmap() && use_bitmap) {
|
||||
m.array_index = tarMaps;
|
||||
m.map_index = _layer;
|
||||
} else {
|
||||
@@ -124,12 +125,12 @@ void Map::copyToQGLMap(QGLMap & m) const {
|
||||
Material::Material(const QString _name)/*: map_reflection(512)*/ {
|
||||
setTypes();
|
||||
name = _name;
|
||||
color_diffuse = color_specular = Qt::darkGray;
|
||||
color_diffuse = Qt::white;
|
||||
color_emission = Qt::black;
|
||||
glass = false;
|
||||
transparency = reflectivity = 0.f;
|
||||
map_roughness.color_amount = 0.75f;
|
||||
map_specular.color_amount = 1.f;
|
||||
map_metalness.color_amount = 0.25f;
|
||||
iof = 1.f;
|
||||
dispersion = 0.05f;
|
||||
_changed = true;
|
||||
@@ -150,7 +151,7 @@ bool Material::hasTransparency() const {
|
||||
bool Material::isMapsChanged() const {
|
||||
return map_diffuse ._changed ||
|
||||
map_normal ._changed ||
|
||||
map_specular ._changed ||
|
||||
map_metalness._changed ||
|
||||
map_roughness._changed ||
|
||||
map_emission ._changed ||
|
||||
map_relief ._changed;
|
||||
@@ -161,7 +162,7 @@ bool Material::isMapChanged(int type) const {
|
||||
switch (type) {
|
||||
case mtDiffuse : return map_diffuse ._changed;
|
||||
case mtNormal : return map_normal ._changed;
|
||||
case mtSpecular : return map_specular ._changed;
|
||||
case mtMetalness: return map_metalness._changed;
|
||||
case mtRoughness: return map_roughness._changed;
|
||||
case mtEmission : return map_emission ._changed;
|
||||
case mtRelief : return map_relief ._changed;
|
||||
@@ -173,7 +174,7 @@ bool Material::isMapChanged(int type) const {
|
||||
void Material::load(TextureManager * tm) {
|
||||
map_diffuse .load(tm);
|
||||
map_normal .load(tm);
|
||||
map_specular .load(tm);
|
||||
map_metalness.load(tm);
|
||||
map_roughness.load(tm);
|
||||
map_emission .load(tm);
|
||||
map_relief .load(tm);
|
||||
@@ -183,7 +184,7 @@ void Material::load(TextureManager * tm) {
|
||||
void Material::setMapsChanged() {
|
||||
map_diffuse ._changed = true;
|
||||
map_normal ._changed = true;
|
||||
map_specular ._changed = true;
|
||||
map_metalness._changed = true;
|
||||
map_roughness._changed = true;
|
||||
map_emission ._changed = true;
|
||||
map_relief ._changed = true;
|
||||
@@ -191,10 +192,10 @@ void Material::setMapsChanged() {
|
||||
|
||||
|
||||
void Material::setTypes() {
|
||||
map_diffuse ._type = mtDiffuse;
|
||||
map_normal ._type = mtNormal;
|
||||
map_specular ._type = mtSpecular;
|
||||
map_diffuse ._type = mtDiffuse ;
|
||||
map_normal ._type = mtNormal ;
|
||||
map_metalness._type = mtMetalness;
|
||||
map_roughness._type = mtRoughness;
|
||||
map_emission ._type = mtEmission;
|
||||
map_relief ._type = mtRelief;
|
||||
map_emission ._type = mtEmission ;
|
||||
map_relief ._type = mtRelief ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user