I was about to play around with some procedural textures.
I came across ogre procedural, but it seemed like a plugin to me. Is this correct?
https://ogrecave.github.io/ogre-procedu ... tures.html
Is it possible to use procedural textures in vanilla ogre 1.12 and maybe also generate some?
Thanks for helping
Procedural generated textures
- sercero
- Bronze Sponsor
- Posts: 450
- Joined: Sun Jan 18, 2015 4:20 pm
- Location: Buenos Aires, Argentina
- x 156
Re: Procedural generated textures
Hello,
As far as I know you cannot generate procedural textures in vanilla OGRE.
I have not used OGRE procedural but it seems to be a library not a plugin.
So you should compile it separately and use it from withing your OGRE app.
Check out the wiki page and the forum to get more information:
http://wiki.ogre3d.org/Ogre+Procedural+Geometry+Library
As far as I know you cannot generate procedural textures in vanilla OGRE.
I have not used OGRE procedural but it seems to be a library not a plugin.
So you should compile it separately and use it from withing your OGRE app.
Check out the wiki page and the forum to get more information:
http://wiki.ogre3d.org/Ogre+Procedural+Geometry+Library
- Zeckurbo
- Gnoblar
- Posts: 9
- Joined: Wed Nov 11, 2020 6:13 pm
Re: Procedural generated textures
Thank you for your answer.
Do you know if vanilla Ogre can display a procedural texture in any kind of way?
Do you know if vanilla Ogre can display a procedural texture in any kind of way?
-
- OGRE Team Member
- Posts: 1995
- Joined: Sun Mar 30, 2014 2:51 pm
- x 1075
- Contact:
Re: Procedural generated textures
well, ogre-procedural displays procedural textures using ogre, so it must be possible somehow..
- Kojack
- OGRE Moderator
- Posts: 7157
- Joined: Sun Jan 25, 2004 7:35 am
- Location: Brisbane, Australia
- x 534
Re: Procedural generated textures
If you mean generating textures by code, it's fairly easy in Ogre 1.x.
Here's a quick hack demo of bare texture generation (been a few years since I've done this, so not sure if there's currently a better way).
This generates a procedural brick texture.
If you want something higher level like Ogre Procedural does (cells, gradients, noise, etc) that's not in Ogre, you'd have to write those effects yourself.
Here's a quick hack demo of bare texture generation (been a few years since I've done this, so not sure if there's currently a better way).
Code: Select all
Ogre::Entity* ent = scnMgr->createEntity("Sinbad.mesh");
Ogre::SceneNode* node = scnMgr->getRootSceneNode()->createChildSceneNode();
node->attachObject(ent);
auto tex = Ogre::TextureManager::getSingleton().createManual("brick", "General", Ogre::TextureType::TEX_TYPE_2D, 256, 256, 1, Ogre::PixelFormat::PF_B8G8R8A8);
auto hpb = tex->getBuffer();
auto pb = hpb->lock(Ogre::Box(0, 0, 255, 255), Ogre::HardwareBuffer::LockOptions::HBL_DISCARD);
for (int y = 0; y < 256; ++y)
{
for (int x = 0; x < 256; ++x)
{
Ogre::ColourValue c(1, 1, 1, 1);
if (y % 8 == 0)
c = Ogre::ColourValue(0, 0, 0, 1);
if((x+((y/8)%2)*8)%16==0)
c = Ogre::ColourValue(0, 0, 0, 1);
pb.setColourAt(c, x, y, 0);
}
}
hpb->unlock();
auto mat = ent->getSubEntity(1)->getMaterial();
mat->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setTexture(tex);
If you want something higher level like Ogre Procedural does (cells, gradients, noise, etc) that's not in Ogre, you'd have to write those effects yourself.