[TL;DR Can I make my own custom Unlit (with pieces), and still let "the system" (material scripts) see vanilla Unlit? How? ]
As mentioned, I am porting a small project from 1.10 to 2.1. The project wants to display a "POINT_LIST" using the Unlit shader template.
Problem: Because I want to send additional data to the vertex shader, I am adding a piece file (under "/Stars/") to the system, so that when I load Unlit
Code: Select all
Ogre::Archive *customLibrary = Ogre::ArchiveManager::getSingletonPtr()->load(
dataFolder + "Hlms/Stars/" + shaderSyntax,
"FileSystem", true);
Ogre::Archive *archiveLibrary = Ogre::ArchiveManager::getSingletonPtr()->load(
dataFolder + "Hlms/Common/" + shaderSyntax,
"FileSystem", true);
Ogre::ArchiveVec library;
library.push_back(customLibrary);
library.push_back(archiveLibrary);
// ******************
// ** UNLIT SHADER **
// ******************
Ogre::Archive *archiveUnlit = Ogre::ArchiveManager::getSingletonPtr()->load(
dataFolder + "Hlms/Unlit/" + shaderSyntax,
"FileSystem", true);
Ogre::HlmsUnlit *hlmsUnlit = OGRE_NEW Ogre::HlmsUnlit(archiveUnlit, &library);
Ogre::Root::getSingleton().getHlmsManager()->registerHlms(hlmsUnlit);
Example material in OgreCore.zip
Code: Select all
hlms Core/OgreText unlit : BaseSettingsAlphaBlend
{
diffuse_map ogretext.png
}
Thanks!