patch 1
This commit is contained in:
@@ -51,7 +51,7 @@ void Tutorial04::loadMesh() {
|
||||
|
||||
/**
|
||||
* Load mesh data
|
||||
* Texture names are the material names "usemtl <material name>"
|
||||
* Texture file names are loaded from .mtl file (map_Kd field).
|
||||
*/
|
||||
auto data =
|
||||
ObjLoader::load(FileUtils::fromCwd("de_dust2/de_dust2.obj"), options);
|
||||
@@ -67,8 +67,9 @@ void Tutorial04::loadMesh() {
|
||||
renderOptions.frustumCulling = Tyra::PipelineFrustumCulling_None;
|
||||
|
||||
/**
|
||||
* Function which load all textures into texture repository,
|
||||
* based on material names.
|
||||
* Function which load all textures into texture repository.
|
||||
* It will automatically extract filename from path (map_Kd) and add
|
||||
* proper extension.
|
||||
*/
|
||||
engine->renderer.getTextureRepository().addByMesh(
|
||||
mesh.get(), FileUtils::fromCwd("de_dust2/"), "png");
|
||||
|
||||
@@ -21,6 +21,8 @@ Tutorial05::~Tutorial05() {
|
||||
}
|
||||
|
||||
void Tutorial05::init() {
|
||||
engine->renderer.setClearScreenColor(Color(32.0F, 32.0F, 32.0F));
|
||||
|
||||
dynpip.setRenderer(&engine->renderer.core);
|
||||
|
||||
cameraPosition = Vec4(0.0F, 0.0F, -10.0F);
|
||||
|
||||
@@ -76,12 +76,9 @@ void Tutorial07::loadMeshWithLightmap() {
|
||||
auto data = ObjLoader::load(FileUtils::fromCwd("cup.obj"), options);
|
||||
|
||||
/**
|
||||
* We don't want to load texture coordinates,
|
||||
* because this obj file has no texture.
|
||||
*
|
||||
* Anyways you can use texture as well.
|
||||
* This model has no texture (it was exported without UV data),
|
||||
* but you can use lighting with textures as well.
|
||||
*/
|
||||
data->textureCoordsEnabled = false;
|
||||
|
||||
/** Lets add lightmap manually */
|
||||
setLightmap(data.get());
|
||||
@@ -120,7 +117,7 @@ void Tutorial07::setDirectionalLightsOptions() {
|
||||
|
||||
void Tutorial07::setLightmap(MeshBuilderData* data) {
|
||||
/** Information for mesh, that data has lightmap */
|
||||
data->lightMapEnabled = true;
|
||||
data->loadLightmap = true;
|
||||
|
||||
/** This object file has only 1 material */
|
||||
auto* material = data->materials[0];
|
||||
|
||||
@@ -92,7 +92,6 @@ void Tutorial08::loadCupMesh() {
|
||||
options.scale = 3.0F;
|
||||
|
||||
auto data = ObjLoader::load(FileUtils::fromCwd("cup/cup.obj"), options);
|
||||
data->textureCoordsEnabled = false;
|
||||
|
||||
cupMesh = std::make_unique<StaticMesh>(data.get());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user