Thanks for pointing "PolygonFont" out to me. I've used FTGL in the past, but only for textured fonts.
If I reach this on my to do list before you implementing it in Ogre Procedural I will try to update Assafs project...

Thanks for pointing "PolygonFont" out to me. I've used FTGL in the past, but only for textured fonts.
I put the changes there for ease of future exchange: http://code.google.com/r/mjklaim-ogre-procedural/Mikachu wrote:@Klaim: I prefer the first solution, looks much simpler, and if it fixes the issue you had, it's worth the "cost".
Code: Select all
z += fac * mPoints[i].y;
Code: Select all
z += fac * mPoints[i].z;
Ok, I'll pull your patches from that.Klaim wrote:I put the changes there for ease of future exchange: http://code.google.com/r/mjklaim-ogre-procedural/
(maybe I should have used bitbucket instead...)
This article states that using ++iterator instead of iterator++ only has an impact on performances for debug mode, the compiler optimizes it in release mode.Klaim wrote:- You have tons of loops using iterators 'it' by incrementing it this way: it++. It can cause performance problems (see http://forums.codeguru.com/showthread.p ... stead-of-i and most well known C++ books) and the fix is to do ++it instead.
I'm currently working on a patch that impacts the triangulator.Klaim wrote:- In ProceduralTriangulator.cpp , the "void Triangulator::addToTriangleBuffer(TriangleBuffer& buffer) const" function contain a big if. PVS points that both branches are equivalent code. My eye can't catch a difference either but maybe there is a subtility?
OkKlaim wrote:- In ProceduralMultiShape.cpp, line 122: beware of the commented code and the indentation!!! You should check that this part is correct and add {} to differenciate which line goes with which if or else!
Oops! I think I missed that one...Klaim wrote:- In ProceduralPathGenerators.cpp, line 188:
I am sure compilers tend to detect this kind of thing but it is not guaranteed and highly depends on compiler flags. Also fast debug mode might be vital for, for example, some video games. This article is good but should try to use different compilers and setups other than just Debug and Release from VS.Mikachu wrote:This article states that using ++iterator instead of iterator++ only has an impact on performances for debug mode, the compiler optimizes it in release mode.Klaim wrote:- You have tons of loops using iterators 'it' by incrementing it this way: it++. It can cause performance problems (see http://forums.codeguru.com/showthread.p ... stead-of-i and most well known C++ books) and the fix is to do ++it instead.
So it doesn't hurt replacing those, but is not really important either.
Correct! Typo of me.Klaim wrote: In ProceduralPathGenerators.cpp, line 188:
Shouldn't it beCode: Select all
z += fac * mPoints[i].y;
Code: Select all
z += fac * mPoints[i].z;
I missed that one, too.Mikachu wrote: Oops! I think I missed that one...
I think this one was implement for SVG loader, and wasn't tested.
You're welcomeVJoe wrote:This is a wonderful library. Many thanks for it.
Yes, on the extruder, you can use setRotationTrack().VJoe wrote:Is it possible to specify a local twist rotation along the extrude axis, at a certain point?
I'm not sure it's actually an issue, it's rather the way flat shading is working...Falarys wrote:I hate to be annoying, but I just encountered another interesting behaviour of the normals I guess.
I changed my material shading mode to flat and as you can see in the screenshot the extruded object has a strange shading. In this scene I have a single directional light.
Do you know any way to come around this? Or might this be a lighting issue of the scene?
About this, I just read this article that might be of great interest to anyone around, because it gets into practical depths of the problem: Is it reasonable to use the prefix increment operator ++it instead of postfix operator it++ for iterators?Klaim wrote:I am sure compilers tend to detect this kind of thing but it is not guaranteed and highly depends on compiler flags. Also fast debug mode might be vital for, for example, some video games. This article is good but should try to use different compilers and setups other than just Debug and Release from VS.Mikachu wrote:This article states that using ++iterator instead of iterator++ only has an impact on performances for debug mode, the compiler optimizes it in release mode.Klaim wrote:- You have tons of loops using iterators 'it' by incrementing it this way: it++. It can cause performance problems (see http://forums.codeguru.com/showthread.p ... stead-of-i and most well known C++ books) and the fix is to do ++it instead.
So it doesn't hurt replacing those, but is not really important either.
Code: Select all
tests = Procedural.LuaTests_getInstance()
tb = Procedural.TriangleBuffer()
Procedural.BoxGenerator():setScale(2):addToTriangleBuffer(tb)
tb:transformToMesh("box")
Procedural.ShowNormalsGenerator():setTriangleBuffer(tb):setVisualStyle(Procedural.ShowNormalsGenerator_VS_ARROW):buildMesh("normals")
tests:addMesh("box")
tests:addMesh("normals", "BaseWhiteNoLighting")
Right, sorry XDMikachu wrote:@Klaim :
Oops, isn't that the same article that I linked above?
It was cross-posted on viva64 and codeproject...
But it's an interesting article, indeed.
Great feature!Mikachu wrote:Added a new small feature : show normals.
Code: Select all
int brickLines = 4;
int pxPerBrick = 32;
Procedural::Texture::TextureBuffer bricks(brickLines * pxPerBrick);
// Basic structure
Procedural::Texture::Cell(&bricks).setRegularity(233).setDensity(brickLines).process();
Procedural::Texture::Colours(&bricks).setBrithness(174).setContrast(198).process();
Procedural::Texture::TextureBuffer distort(brickLines * pxPerBrick);
Procedural::Texture::Solid(&distort).setColour((Ogre::uchar)125, (Ogre::uchar)133, (Ogre::uchar)0, (Ogre::uchar)255).process();
Procedural::Texture::Rectangle rectDraw(&distort);
for(size_t i = 1; i < brickLines; i++)
{
Ogre::ColourValue rc = Ogre::ColourValue((i % 2 == 0) ? Ogre::Math::RangeRandom(0.4f, 0.6f) : Ogre::Math::RangeRandom(0.0f, 0.2f), 0.52f, 1.0f);
rc.a = 1.0f;
rectDraw.setRectangle(0, i * pxPerBrick, brickLines * pxPerBrick, i * pxPerBrick + pxPerBrick).setColour(rc).process();
}
Procedural::Texture::Distort(&bricks).setParameterImage(&distort).setPower(50).process();
Procedural::Texture::Cloud(&distort).process();
Procedural::Texture::Normals(&distort).process();
Procedural::Texture::Distort(&bricks).setParameterImage(&distort).setPower(8).process();
Procedural::Texture::TextureBuffer normal(&bricks);
// Normal map & lightning
Procedural::Texture::TextureBuffer light(&bricks);
Procedural::Texture::Colours(&light).setColourBase(0.325f, 0.0f, 0.0f, 0.0f).setColourPercent(0.78f, 0.443f, 0.333f, 1.0f).process();
Procedural::Texture::Normals(&normal).process();
Procedural::Texture::Light(&light).setNormalMap(&normal).setColourAmbient(0.164f, 0.0f, 0.0f, 0.0f).setPosition(255.0f, 255.0f, 200.0f).setBumpPower(48).setSpecularPower(8).process();
// Joint
Procedural::Texture::TextureBuffer joint(&bricks);
Procedural::Texture::Invert(&joint).process();
Procedural::Texture::Threshold(&joint).setThreshold(200).setRatio(255).process();
Procedural::Texture::Colours(&joint).setColourBase(0.215f, 0.207f, 0.137f, 0.0f).setColourPercent(0.294f, 0.266f, 0.345f, 1.0f).setBrithness(110).setContrast(153).process();
// Additional structure
Procedural::Texture::TextureBuffer colourcloud(&bricks);
Procedural::Texture::Threshold(&colourcloud).process();
Procedural::Texture::TextureBuffer cloud(&bricks);
Procedural::Texture::Cloud(&cloud).process();
Procedural::Texture::Combine(&colourcloud).addImage(&cloud, Procedural::Texture::Combine::METHOD_MULTIPLY).process();
Procedural::Texture::Colours(&colourcloud).setColourBase(0.329f, 0.141f, 0.0f, 0.0f).setColourPercent(0.95f, 0.949f, 0.862f, 1.0f).setBrithness(30).process();
// Finish texture
Procedural::Texture::Combine(&light)
.addImage(&joint, Procedural::Texture::Combine::METHOD_ADD_CLAMP)
.addImage(&colourcloud, Procedural::Texture::Combine::METHOD_ADD_CLAMP)
.process();
Ogre::TexturePtr demoTexture = light.createTexture("proceduralTexture");
//Ogre::TexturePtr demoTextureNormal = normal.createTexture("proceduralTextureNormal");
Ogre::MaterialPtr demoMaterial = Ogre::MaterialManager::getSingletonPtr()->create("proceduralMaterial", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
demoMaterial->getTechnique(0)->getPass(0)->createTextureUnitState("proceduralTexture");
demoMaterial->getTechnique(0)->getPass(0)->setSceneBlending(Ogre::SceneBlendType::SBT_TRANSPARENT_ALPHA);
I prefer the second solution, because I really don't like putting generated stuff into source control.Transporter wrote:There are two possible ways to resolve this problem:
Distributing the images via source code control.
Force building & running illustrations before creating the doc.
I prefer offline versions of help docs, because of a slowly and volume limited internet connection at home (not hereMikachu wrote:... as a zipped archive (for those who prefer and offline version, for whatever reason).