Bulk update nvpro-samples 11/20/23
5c72ddfc0522eb6604828e74886cf39be646ba78
This commit is contained in:
parent
debd0d5e33
commit
0c73e8ec1b
96 changed files with 927 additions and 922 deletions
|
|
@ -37,11 +37,11 @@ void ObjLoader::loadModel(const std::string& filename)
|
|||
for(const auto& material : reader.GetMaterials())
|
||||
{
|
||||
MaterialObj m;
|
||||
m.ambient = nvmath::vec3f(material.ambient[0], material.ambient[1], material.ambient[2]);
|
||||
m.diffuse = nvmath::vec3f(material.diffuse[0], material.diffuse[1], material.diffuse[2]);
|
||||
m.specular = nvmath::vec3f(material.specular[0], material.specular[1], material.specular[2]);
|
||||
m.emission = nvmath::vec3f(material.emission[0], material.emission[1], material.emission[2]);
|
||||
m.transmittance = nvmath::vec3f(material.transmittance[0], material.transmittance[1], material.transmittance[2]);
|
||||
m.ambient = glm::vec3(material.ambient[0], material.ambient[1], material.ambient[2]);
|
||||
m.diffuse = glm::vec3(material.diffuse[0], material.diffuse[1], material.diffuse[2]);
|
||||
m.specular = glm::vec3(material.specular[0], material.specular[1], material.specular[2]);
|
||||
m.emission = glm::vec3(material.emission[0], material.emission[1], material.emission[2]);
|
||||
m.transmittance = glm::vec3(material.transmittance[0], material.transmittance[1], material.transmittance[2]);
|
||||
m.dissolve = material.dissolve;
|
||||
m.ior = material.ior;
|
||||
m.shininess = material.shininess;
|
||||
|
|
@ -113,10 +113,10 @@ void ObjLoader::loadModel(const std::string& filename)
|
|||
VertexObj& v1 = m_vertices[m_indices[i + 1]];
|
||||
VertexObj& v2 = m_vertices[m_indices[i + 2]];
|
||||
|
||||
nvmath::vec3f n = nvmath::normalize(nvmath::cross((v1.pos - v0.pos), (v2.pos - v0.pos)));
|
||||
v0.nrm = n;
|
||||
v1.nrm = n;
|
||||
v2.nrm = n;
|
||||
glm::vec3 n = glm::normalize(glm::cross((v1.pos - v0.pos), (v2.pos - v0.pos)));
|
||||
v0.nrm = n;
|
||||
v1.nrm = n;
|
||||
v2.nrm = n;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
*/
|
||||
|
||||
#pragma once
|
||||
#include "nvmath/nvmath.h"
|
||||
#include <glm/glm.hpp>
|
||||
#include "tiny_obj_loader.h"
|
||||
#include <array>
|
||||
#include <iostream>
|
||||
|
|
@ -29,15 +29,15 @@
|
|||
// Structure holding the material
|
||||
struct MaterialObj
|
||||
{
|
||||
nvmath::vec3f ambient = nvmath::vec3f(0.1f, 0.1f, 0.1f);
|
||||
nvmath::vec3f diffuse = nvmath::vec3f(0.7f, 0.7f, 0.7f);
|
||||
nvmath::vec3f specular = nvmath::vec3f(1.0f, 1.0f, 1.0f);
|
||||
nvmath::vec3f transmittance = nvmath::vec3f(0.0f, 0.0f, 0.0f);
|
||||
nvmath::vec3f emission = nvmath::vec3f(0.0f, 0.0f, 0.10);
|
||||
float shininess = 0.f;
|
||||
float ior = 1.0f; // index of refraction
|
||||
float dissolve = 1.f; // 1 == opaque; 0 == fully transparent
|
||||
// illumination model (see http://www.fileformat.info/format/material/)
|
||||
glm::vec3 ambient = glm::vec3(0.1f, 0.1f, 0.1f);
|
||||
glm::vec3 diffuse = glm::vec3(0.7f, 0.7f, 0.7f);
|
||||
glm::vec3 specular = glm::vec3(1.0f, 1.0f, 1.0f);
|
||||
glm::vec3 transmittance = glm::vec3(0.0f, 0.0f, 0.0f);
|
||||
glm::vec3 emission = glm::vec3(0.0f, 0.0f, 0.10);
|
||||
float shininess = 0.f;
|
||||
float ior = 1.0f; // index of refraction
|
||||
float dissolve = 1.f; // 1 == opaque; 0 == fully transparent
|
||||
// illumination model (see http://www.fileformat.info/format/material/)
|
||||
int illum = 0;
|
||||
int textureID = -1;
|
||||
};
|
||||
|
|
@ -45,10 +45,10 @@ struct MaterialObj
|
|||
// NOTE: BLAS builder depends on pos being the first member
|
||||
struct VertexObj
|
||||
{
|
||||
nvmath::vec3f pos;
|
||||
nvmath::vec3f nrm;
|
||||
nvmath::vec3f color;
|
||||
nvmath::vec2f texCoord;
|
||||
glm::vec3 pos;
|
||||
glm::vec3 nrm;
|
||||
glm::vec3 color;
|
||||
glm::vec2 texCoord;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue