diff --git a/Content/RNR/fonts/BackMaterial.material b/Content/RNR/fonts/BackMaterial.material new file mode 100644 index 0000000..69d9665 --- /dev/null +++ b/Content/RNR/fonts/BackMaterial.material @@ -0,0 +1,15 @@ +// generated by blender2ogre 0.8.3 on 2023-07-17 02:58:22 +material BackMaterial { + receive_shadows on + technique { + pass { + diffuse 0.8 0.8 0.8 1.0 + specular 0.5 0.0 0 0 0 + rtshader_system { + lighting_stage metal_roughness + texturing_stage late_add_blend + } + + } + } +} diff --git a/Content/RNR/fonts/BottomMaterial.material b/Content/RNR/fonts/BottomMaterial.material new file mode 100644 index 0000000..608d795 --- /dev/null +++ b/Content/RNR/fonts/BottomMaterial.material @@ -0,0 +1,15 @@ +// generated by blender2ogre 0.8.3 on 2023-07-17 02:58:22 +material BottomMaterial { + receive_shadows on + technique { + pass { + diffuse 0.8 0.8 0.8 1.0 + specular 0.5 0.0 0 0 0 + rtshader_system { + lighting_stage metal_roughness + texturing_stage late_add_blend + } + + } + } +} diff --git a/Content/RNR/fonts/Cube.mesh b/Content/RNR/fonts/Cube.mesh index 5eefe5e..618fb9b 100644 Binary files a/Content/RNR/fonts/Cube.mesh and b/Content/RNR/fonts/Cube.mesh differ diff --git a/Content/RNR/fonts/FrontMaterial.material b/Content/RNR/fonts/FrontMaterial.material new file mode 100644 index 0000000..da97fcc --- /dev/null +++ b/Content/RNR/fonts/FrontMaterial.material @@ -0,0 +1,15 @@ +// generated by blender2ogre 0.8.3 on 2023-07-17 02:58:22 +material FrontMaterial { + receive_shadows on + technique { + pass { + diffuse 0.8 0.8 0.8 1.0 + specular 0.5 0.0 0 0 0 + rtshader_system { + lighting_stage metal_roughness + texturing_stage late_add_blend + } + + } + } +} diff --git a/Content/RNR/fonts/LeftMaterial.material b/Content/RNR/fonts/LeftMaterial.material new file mode 100644 index 0000000..eefafd4 --- /dev/null +++ b/Content/RNR/fonts/LeftMaterial.material @@ -0,0 +1,15 @@ +// generated by blender2ogre 0.8.3 on 2023-07-17 02:58:22 +material LeftMaterial { + receive_shadows on + technique { + pass { + diffuse 0.8 0.8 0.8 1.0 + specular 0.5 0.0 0 0 0 + rtshader_system { + lighting_stage metal_roughness + texturing_stage late_add_blend + } + + } + } +} diff --git a/Content/RNR/fonts/RightMaterial.material b/Content/RNR/fonts/RightMaterial.material new file mode 100644 index 0000000..a33bdad --- /dev/null +++ b/Content/RNR/fonts/RightMaterial.material @@ -0,0 +1,15 @@ +// generated by blender2ogre 0.8.3 on 2023-07-17 02:58:22 +material RightMaterial { + receive_shadows on + technique { + pass { + diffuse 0.8 0.8 0.8 1.0 + specular 0.5 0.0 0 0 0 + rtshader_system { + lighting_stage metal_roughness + texturing_stage late_add_blend + } + + } + } +} diff --git a/Content/RNR/fonts/TopMaterial.material b/Content/RNR/fonts/TopMaterial.material new file mode 100644 index 0000000..91b3370 --- /dev/null +++ b/Content/RNR/fonts/TopMaterial.material @@ -0,0 +1,15 @@ +// generated by blender2ogre 0.8.3 on 2023-07-17 02:58:22 +material TopMaterial { + receive_shadows on + technique { + pass { + diffuse 0.8 0.8 0.8 1.0 + specular 0.5 0.0 0 0 0 + rtshader_system { + lighting_stage metal_roughness + texturing_stage late_add_blend + } + + } + } +} diff --git a/Content/RNR/fonts/part_mesh.scene b/Content/RNR/fonts/part_mesh.scene index 62b1ab7..9f1cc37 100644 --- a/Content/RNR/fonts/part_mesh.scene +++ b/Content/RNR/fonts/part_mesh.scene @@ -1,28 +1,36 @@ - + + - + - + - - - - - - - - - + + + + + + + + + + + + + + + + diff --git a/Content/RNR/textures/stud_top.png b/Content/RNR/textures/stud_top.png new file mode 100644 index 0000000..4909d66 Binary files /dev/null and b/Content/RNR/textures/stud_top.png differ diff --git a/Content/RNR/textures/surfaces.png b/Content/RNR/textures/surfaces.png new file mode 100644 index 0000000..2207cbd Binary files /dev/null and b/Content/RNR/textures/surfaces.png differ diff --git a/Dependencies/Luau b/Dependencies/Luau index 2181591..e25de95 160000 --- a/Dependencies/Luau +++ b/Dependencies/Luau @@ -1 +1 @@ -Subproject commit 218159140c7d79ae745e646da721d12331f536f5 +Subproject commit e25de95445f2d635a125ab463426bb7fda017093 diff --git a/Projects/Engine/Source/App/V8/DataModel/Workspace.cpp b/Projects/Engine/Source/App/V8/DataModel/Workspace.cpp index ebc0001..de65c9e 100644 --- a/Projects/Engine/Source/App/V8/DataModel/Workspace.cpp +++ b/Projects/Engine/Source/App/V8/DataModel/Workspace.cpp @@ -13,6 +13,12 @@ namespace RNR m_geom->setCastShadows(true); m_partEntity = world->getOgreSceneManager()->createEntity("fonts/Cube.mesh"); m_partEntity->setCastShadows(true); + + for(int i = 0; i < m_partEntity->getNumSubEntities(); i++) + { + Ogre::SubEntity* surface = m_partEntity->getSubEntity(i); + Ogre::TextureUnitState* texture = surface->getMaterial()->getTechnique(0)->getPass(0)->createTextureUnitState("textures/stud_top.png"); + } } void Workspace::onChildAdded(Instance* childAdded) @@ -25,9 +31,30 @@ namespace RNR PartInstance* child_part = dynamic_cast(instance); if(child_part) { -#ifndef DONT_USE_BRICKCOLOR_MATERIAL - m_partEntity->setMaterial(BrickColor::material(child_part->getBrickColor())); -#endif + Ogre::Vector3 part_size = child_part->getSize(); + for(int i = 0; i < m_partEntity->getNumSubEntities(); i++) + { + Ogre::SubEntity* surface = m_partEntity->getSubEntity(i); + Ogre::TextureUnitState* texture = surface->getMaterial()->getTechnique(0)->getPass(0)->getTextureUnitState(0); + + Ogre::Vector2 uvs; + + std::string surf_name = std::string(surface->getMaterialName().c_str()); + if(surf_name == "TopMaterial") + uvs = Ogre::Vector2(part_size.x, part_size.z); + else if(surf_name == "BottomMaterial") + uvs = Ogre::Vector2(-part_size.x, part_size.z); + else if(surf_name == "LeftMaterial") + uvs = Ogre::Vector2(part_size.y, part_size.z); + else if(surf_name == "RightMaterial") + uvs = Ogre::Vector2(-part_size.y, part_size.z); + else if(surf_name == "BackMaterial") + uvs = Ogre::Vector2(part_size.x, part_size.z); + else if(surf_name == "FrontMaterial") + uvs = Ogre::Vector2(-part_size.x, part_size.z); + + texture->setTextureScale(uvs.x,uvs.y); + } m_geom->addEntity(m_partEntity, child_part->getCFrame().getPosition(), Ogre::Quaternion(child_part->getCFrame().getRotation()),