2D: Faster way to roll an image?
Re: 2D: Faster way to roll an image?
Thx pf_shadoko,
I have saved your code and an original 360 degree photo under the link above ( http://u.pc.cd/mvx7 )
saved.
Unfortunately, Ogre or the technology doesn't seem to be able to handle higher resolution images.
LoadTexture(0,GetFilePart(image)) failed. Tested with PB 6.11 x64.
The image resolution is: 11.904x5.592 pixel.
My goal would be to be able to process the actual panorama images that are composed from drone photos.
These have a resolution of 20.192 x 10.096 pixels.
Kind regards
Dige
I have saved your code and an original 360 degree photo under the link above ( http://u.pc.cd/mvx7 )
saved.
Unfortunately, Ogre or the technology doesn't seem to be able to handle higher resolution images.
LoadTexture(0,GetFilePart(image)) failed. Tested with PB 6.11 x64.
The image resolution is: 11.904x5.592 pixel.
My goal would be to be able to process the actual panorama images that are composed from drone photos.
These have a resolution of 20.192 x 10.096 pixels.
Kind regards
Dige
"Daddy, I'll run faster, then it is not so far..."
Re: 2D: Faster way to roll an image?
The code below ignores direction for now and is hardcoded to 'down'.dige wrote: Wed Jul 03, 2024 8:29 am My goal would be to be able to process the actual panorama images that are composed from drone photos.
These have a resolution of 20.192 x 10.096 pixels.
The purpose is so you can test if the approach with DrawigBuffer would be of any help to you.
If it does help, up, left and right can be added as well.
Code: Select all
Procedure RollImage (ImgID, direction, offset)
If StartDrawing(ImageOutput(ImgID))
*db = DrawingBuffer()
pitch = DrawingBufferPitch()
po = pitch * offset
*m = AllocateMemory(po, #PB_Memory_NoClear)
CopyMemory(*db, *m, po)
MoveMemory(*db + po, *db, pitch * (OutputHeight() - offset))
CopyMemory(*m, *db + pitch * (OutputHeight() - offset), po)
FreeMemory(*m)
StopDrawing()
EndIf
EndProcedure
Windows (x64)
Raspberry Pi OS (Arm64)
Raspberry Pi OS (Arm64)
Re: 2D: Faster way to roll an image?
@dige: Is the full path to the image being specified?
Re: 2D: Faster way to roll an image?
Yes. It runs fine with the './Pano_360.jpg', but not with './Insta360_X4_Smaple_image.jpg'
"Daddy, I'll run faster, then it is not so far..."
Re: 2D: Faster way to roll an image?
Well done wilbert! Your code seems to be 4x times faster! Thank you very muchwilbert wrote: Wed Jul 03, 2024 8:43 am The code below ignores direction for now and is hardcoded to 'down'.
The purpose is so you can test if the approach with DrawigBuffer would be of any help to you.
If it does help, up, left and right can be added as well.
[..]

"Daddy, I'll run faster, then it is not so far..."
Re: 2D: Faster way to roll an image?
That's good to know.

Would all directions (horizontal, vertical, diagonal) be equally important and used for you big 20.192 x 10.096 pixel images ?
What would be the minimum and maximum offset values you intend to use ?
Windows (x64)
Raspberry Pi OS (Arm64)
Raspberry Pi OS (Arm64)
- pf shadoko
- Enthusiast
- Posts: 385
- Joined: Thu Jul 09, 2015 9:07 am
Re: 2D: Faster way to roll an image?
it's not a problem related to the 3d PB (ogre): in my case, your 11904 X 5952 image works fine.
it must be linked to the graphics circuit
I've modified the code to support zooming (with mousewheel)
it must be linked to the graphics circuit
I've modified the code to support zooming (with mousewheel)
Code: Select all
InitEngine3D():InitSprite():InitKeyboard():InitMouse()
ExamineDesktops()
OpenWindow(0, 0,0, DesktopWidth(0)*0.8,DesktopHeight(0)*0.8, "CreateShader - [Esc] quit",#PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0), 0, 0, WindowWidth(0), WindowHeight(0), 0, 0, 0)
image.s="C:\Users\Guillot\Downloads\Insta360_X4_Smaple_image.jpg"
If FileSize(image)<0:MessageRequester("!", "enter 360 panoramic image path (above)"):CallDebugger:EndIf
Add3DArchive(GetPathPart(image), #PB_3DArchive_FileSystem):Parse3DScripts()
LoadTexture(0,GetFilePart(image))
CreateCamera(0, 0, 0, 100, 100):MoveCamera(0,0,3,-6):CameraLookAt(0,0,0,0)
CreateMaterial(0,TextureID(0))
DisableMaterialLighting(0,1)
MaterialCullingMode(0,#PB_Material_AntiClockWiseCull)
MaterialFilteringMode(0,#PB_Material_Anisotropic)
CreateSphere(0,1000,64,64)
CreateEntity(0,MeshID(0),MaterialID(0))
Define.f MouseX,Mousey,fov=45
Repeat
While WindowEvent():Wend
ExamineKeyboard()
ExamineMouse()
MouseX = -MouseDeltaX() * 0.05
MouseY = -MouseDeltaY() * 0.05
FOV-MouseWheel()*5:If fov<10:fov=10:ElseIf fov>90:fov=90:EndIf
CameraFOV(0,fov)
RotateCamera(0, MouseY, MouseX, 0, #PB_Relative)
RenderWorld()
FlipBuffers()
Until KeyboardReleased(#PB_Key_Escape) Or MouseButton(3)
Re: 2D: Faster way to roll an image?
Perfect! 

Re: 2D: Faster way to roll an image?
I can confirm it works perfectly here as well with the big pic (a bit slow to start though) on a very old gfx card and it looks fantastic !
Re: 2D: Faster way to roll an image?
Oh what a pity that it doesn't work hereFred wrote: Wed Jul 03, 2024 4:00 pm I can confirm it works perfectly here as well with the big pic (a bit slow to start though) on a very old gfx card and it looks fantastic !


Can you please tell me under which conditions you got the big picture for viewing?
PB version?, x64 / x86? Debugger on / off? Compiled?
Windows version?
I habe Windows 10, Intel i7-6700, NVIDIA FX 580, 24GB RAM
Tested with PB 6.11 x64/x84 - LoadTexture () allways failed

Update:
I have gradually reduced the size of the image by 1000 pixels.
But at a size of 8,000 x 4,000 I got this error
NVIDIA OpenGL Driver
An application has requested more GPLI memory than is available in the system.
The application will now be closed.
Error Code: 6
Would you like to visit
http://nvidia.custhelp.com/app,'answers ... Va_id/3553 for help?
With 7.000 x 3.500 it works, but that is unfortunately far from the required B-size of approx. 20,000 pixels.
Last edited by dige on Thu Jul 04, 2024 8:54 am, edited 1 time in total.
"Daddy, I'll run faster, then it is not so far..."
Re: 2D: Faster way to roll an image?
You must edit the following line with the path and name of your jpg file:
Code: Select all
image.s="C:\Users\Guillot\Downloads\Insta360_X4_Smaple_image.jpg"
Re: 2D: Faster way to roll an image?
Thank you for your help.Caronte3D wrote: Thu Jul 04, 2024 8:51 am You must edit the following line with the path and name of your jpg file:Code: Select all
image.s="C:\Users\Guillot\Downloads\Insta360_X4_Smaple_image.jpg"
But the path is correct, otherwise the check in line 10 would also fail:
Code: Select all
10 : If FileSize(image)<0:MessageRequester("!", "enter 360 panoramic image path (above)"):CallDebugger:EndIf
"Daddy, I'll run faster, then it is not so far..."
Re: 2D: Faster way to roll an image?
Wow, you are using a 15 year old graphic card with just 512MB?
It might be time to invest a few € in something more up to date.
{Home}.:|:.{Dialog Design0R}.:|:.{Codes}.:|:.{History Viewer Online}.:|:.{Send a Beer}
Re: 2D: Faster way to roll an image?
Of course 512 MB is history for GFX cards, no wonder it doesn't work..
Re: 2D: Faster way to roll an image?
Yes, maybe a bit old and no longer suitable for gaming, but so far sufficient for me and I guess, still better than onboard graphics.HeX0R wrote: Thu Jul 04, 2024 9:12 am Wow, you are using a 15 year old graphic card with just 512MB?

But I'm just wondering what Fred meant by a "very old gfx card"
Fred wrote: Wed Jul 03, 2024 4:00 pm I can confirm it works perfectly here as well with the big pic (a bit slow to start though) on a very old gfx card and it looks fantastic !
"Daddy, I'll run faster, then it is not so far..."