I hope this is some ogre3d optimization engine xD
- skinkairewalker
- Enthusiast
- Posts: 772
- Joined: Fri Dec 04, 2015 9:26 pm
I hope this is some ogre3d optimization engine xD
Guys, has anyone noticed this? In the 3D engine, there is a kind of jaggedness, I don't know what it is, but it makes the graphics look "messy" depending on how the player rotates the camera or the angle he looks at.
I hope it's some ogre mechanism for optimization xD.
Can anyone else notice this or am I just going crazy?
screenshot1 : https://i.imgur.com/GQPDuUF.png
screenshot2 : https://i.imgur.com/JJzkRrD.png
video 1 : https://i.imgur.com/oobS7dE.mp4
I hope it's some ogre mechanism for optimization xD.
Can anyone else notice this or am I just going crazy?
screenshot1 : https://i.imgur.com/GQPDuUF.png
screenshot2 : https://i.imgur.com/JJzkRrD.png
video 1 : https://i.imgur.com/oobS7dE.mp4
Re: I hope this is some ogre3d optimization engine xD
That's called mipmapping. The faraway things are textured with a lower resolution texture (auto generated). It can be switched off in the material properties, but then your textures will be pixelated, and the faraway barely visible entities will be textured with full size textures. ( that slows down your program )
Edit: No, I can't touch the mipmapping system, can't be turned off... That's a con. Would be nice to get access to this as well. Filtering is available, try trilinear.
Edit: No, I can't touch the mipmapping system, can't be turned off... That's a con. Would be nice to get access to this as well. Filtering is available, try trilinear.
-
- Addict
- Posts: 2344
- Joined: Mon Jun 02, 2003 9:16 am
- Location: Germany
- Contact:
Re: I hope this is some ogre3d optimization engine xD
You can turn mipmapping off in the material script.
https://ogrecave.github.io/ogre/api/1.1 ... ml#texture
(numMipMaps)
However, mipmapping is used to reduce aliasing artifacts. It's not just a speed thing.
https://ogrecave.github.io/ogre/api/1.1 ... ml#texture
(numMipMaps)
However, mipmapping is used to reduce aliasing artifacts. It's not just a speed thing.
bye,
Daniel
Daniel
Re: I hope this is some ogre3d optimization engine xD
I only use code to create materials...
-
- Addict
- Posts: 2344
- Joined: Mon Jun 02, 2003 9:16 am
- Location: Germany
- Contact:
Re: I hope this is some ogre3d optimization engine xD
Material scripts are code. Checkmate!

bye,
Daniel
Daniel
Re: I hope this is some ogre3d optimization engine xD
You know how I meant it 

Re: I hope this is some ogre3d optimization engine xD
Mipmaps are more responsible for texture reduction the smaller they need to be displayed, so I think it's actually the texture filtering options you need to look at - ensure Anisotropic filtering is enabled using MaterialFilteringMode(), and set it to a high level (x8 or x16) if you can.
- skinkairewalker
- Enthusiast
- Posts: 772
- Joined: Fri Dec 04, 2015 9:26 pm
Re: I hope this is some ogre3d optimization engine xD
Hello guys, thank you very much for sharing your knowledge, I added these 2 lines to the code directly
and added this to the material,
Examples.Material
but it still looks weird, every time I move the camera, it seems like a layer of blur is being added
Code: Select all
ExamineDesktops():dx=DesktopWidth(0)*0.8:dy=DesktopHeight(0)*0.8
OpenWindow(0, 0,0, DesktopUnscaledX(dx),DesktopUnscaledY(dy), "Billboard - [Esc] quit",#PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0), 0, 0, dx, dy, 0, 0, 0)
Add3DArchive(#PB_Compiler_Home + "examples/3d/Data/Textures", #PB_3DArchive_FileSystem)
Add3DArchive(#PB_Compiler_Home + "examples/3d/Data/Models", #PB_3DArchive_FileSystem)
Add3DArchive(#PB_Compiler_Home + "examples/3d/Data/Scripts", #PB_3DArchive_FileSystem)
Add3DArchive(#PB_Compiler_Home + "examples/3d/Data/Packs/skybox.zip", #PB_3DArchive_Zip)
Parse3DScripts()
; HERE >>>>>
AntialiasingMode(#PB_AntialiasingMode_x6)
MaterialFilteringMode(#PB_Default,#PB_Material_Trilinear,16)
Examples.Material
Code: Select all
material Examples/TudorHouse
{
technique
{
pass
{
texture_unit
{
texture fw12b.jpg
tex_address_mode clamp
filtering trilinear
max_anisotropy 16
num_mipmaps unlimited
}
}
}
}
but it still looks weird, every time I move the camera, it seems like a layer of blur is being added
Re: I hope this is some ogre3d optimization engine xD
I think I know what you mean now. It's not texture filtering, but some kind of motion blur like aftereffect on the camera when you turn it. More visible with major movements...
Re: I hope this is some ogre3d optimization engine xD
You've set Trilinear filtering in your sample.pjay wrote: Tue Feb 11, 2025 7:59 am ... ensure Anisotropic filtering is enabled using MaterialFilteringMode(), and set it to a high level (x8 or x16) if you can.
Code: Select all
If InitEngine3D()
Add3DArchive(#PB_Compiler_Home + "examples/3d/Data/Textures", #PB_3DArchive_FileSystem)
InitSprite() : InitKeyboard() : InitMouse()
OpenWindow(0,0,0,800,600,"",#PB_Window_ScreenCentered|#PB_Window_SystemMenu)
OpenWindowedScreen(WindowID(0),0,0,800 * DesktopResolutionX(),600 * DesktopResolutionY())
CreateMaterial(0, LoadTexture(0, "fw12b.jpg"))
MaterialFilteringMode(0,#PB_Material_Anisotropic,16)
CreateCube(0, 50) : CreateEntity(0, MeshID(0), MaterialID(0), 0, 0, 0)
CreateCamera(0, 0, 0, 100, 100)
MoveCamera(0, 30, 0, 70, #PB_Absolute)
CameraBackColor(0, RGB(0,10,20))
AmbientColor(RGB(255, 255, 255))
LoadFont(0,"Segoe UI",15)
CreateImage(1,200,40) : StartDrawing(ImageOutput(1)) : DrawingFont(FontID(0)) : DrawText(0,0,"<- Trilinear",255) : StopDrawing() : *mem = EncodeImage(1) : CatchSprite(0,*mem)
CreateImage(1,200,40) : StartDrawing(ImageOutput(1)) : DrawingFont(FontID(0)) : DrawText(0,0,"<- Anisotropic",RGB(0,255,0)) : StopDrawing() : *mem = EncodeImage(1) : CatchSprite(1,*mem)
FreeMemory(*mem) : LastMode = 99
Repeat
Repeat : Event = WindowEvent() : If event = #PB_Event_CloseWindow : Quit = 1 : EndIf : Until WindowEvent() = 0
ExamineMouse() : ExamineKeyboard()
Mode = ((ElapsedMilliseconds() / 2000) % 2)
If Mode <> LastMode : LastMode = Mode
Select Mode
Case 0 : MaterialFilteringMode(0,#PB_Material_Trilinear) : OnSprite = 0
Case 1 : MaterialFilteringMode(0,#PB_Material_Anisotropic,16) : OnSprite = 1
EndSelect
EndIf
RenderWorld()
DisplaySprite(OnSprite,370 * DesktopResolutionX(),250 * DesktopResolutionX())
FlipBuffers()
Until KeyboardPushed(#PB_Key_Escape) Or Quit = 1
EndIf
- skinkairewalker
- Enthusiast
- Posts: 772
- Joined: Fri Dec 04, 2015 9:26 pm
Re: I hope this is some ogre3d optimization engine xD
Thanks by example
creating the texture manually with:
works fine !!
but applying these parameters to the material:
apparently they are being ignored xD

creating the texture manually with:
Code: Select all
CreateMaterial(0, LoadTexture(0, "fw12b.jpg"))
MaterialFilteringMode(0,#PB_Material_Anisotropic,16)
; Add house
MeshHouse = LoadMesh(#PB_Any, "tudorhouse.mesh")
House = CreateEntity(#PB_Any, MeshID(MeshHouse), MaterialID(0), 0, 280, 0)
ScaleEntity(House, 0.5, 0.5, 0.5)
but applying these parameters to the material:
Code: Select all
material Examples/TudorHouse
{
technique
{
pass
{
texture_unit
{
texture fw12b.jpg
tex_address_mode clamp
filtering anisotropic
max_anisotropy 16
num_mipmaps -1
}
}
}
}