Page 3 of 5

Re: Lib Screen (Sprite) (PB 6.10)

Posted: Fri May 17, 2024 6:53 pm
by Caronte3D
Now works nice! :wink:

Re: Lib Screen (Sprite) (PB 6.10)

Posted: Fri May 17, 2024 7:05 pm
by infratec
case 2 shows only a black screen with dark red text.

The rest is Ok.

PB 6.11b2 x86 on Win10 x64

Works with PB x64

Re: Lib Screen (Sprite) (PB 6.10)

Posted: Fri May 17, 2024 7:11 pm
by Caronte3D
infratec wrote: Fri May 17, 2024 7:05 pm case 2 shows only a black screen with dark red text.
The same here, only x64 is ok on all examples.

Re: Lib Screen (Sprite) (PB 6.10)

Posted: Fri May 17, 2024 7:28 pm
by AZJIO
infratec wrote: Fri May 17, 2024 7:05 pm case 2 shows only a black screen with dark red text.
From the folder "PureBasic 6.10 x64\Examples\3D\Data\Textures" copy the file "waternormal.png" to the folder "PureBasic_x64\Examples\3D\Data\Textures"

All demos work for me (Win10x64, PB6.10)
I had two files marked yellow in the IDE as missing. I added it and everything worked.

Re: Lib Screen (Sprite) (PB 6.10)

Posted: Fri May 17, 2024 7:47 pm
by infratec
All files are available in PB 6.11B2 x86 and x64.
That's not the problem.

Re: Lib Screen (Sprite) (PB 6.10)

Posted: Fri May 17, 2024 8:02 pm
by AZJIO
Yes you are right. I initially launched it on version 6.04 and there were 2 files missing. For the sake of compactness, I’m still using the previous version with the addition of compilers 6.10. In the second frame there is the sea, a view from above and clouds are flying. It works on 6.10 too.

Re: Lib Screen (Sprite) (PB 6.10)

Posted: Sat May 18, 2024 2:44 pm
by pf shadoko
well, it's progressing

I made the correction for x86

Re: Lib Screen (Sprite) (PB 6.10)

Posted: Sat May 18, 2024 6:11 pm
by infratec
Confirmed :!:

Works now in x86 and x64 on WIn10 x64 with PB 6.11B2

Re: Lib Screen (Sprite) (PB 6.10)

Posted: Sun May 19, 2024 12:25 am
by AZJIO
Runs on Linux Fedora, Mint.
On Linux MX_i386 does not start

On Linux, hint text is upside down. Text blue instead of red.
The ground texture in the first and last frames is blue, but should be brown. The water is different from what is in Windows, it is not as contrasting.

Warning for missing files

Code: Select all

CompilerIf #PB_Compiler_Version < 610
	Debug "Check the presence of the files sky.png, waternormal.png"
CompilerEndIf
Add path checking so Linux users can specify the correct file path for their OS

Code: Select all

CompilerElseIf #PB_Compiler_OS = #PB_OS_Linux
	CompilerIf #PB_Compiler_Debugger 
		If FileSize("/usr/lib/x86_64-linux-gnu/libGL.so")
			Debug "Please provide the correct path to the libGL.so library"
		EndIf
	CompilerEndIf
Compatible paths. In Windows, the case of letters in file names is not important, but in Linux it is important

Code: Select all

LoadImage(1,#PB_Compiler_Home+"examples" + #PS$ + "3d" + #PS$ + "Data" + #PS$ + "Textures" + #PS$ + "water.png")
LoadImage(2,#PB_Compiler_Home+"examples" + #PS$ + "3d" + #PS$ + "Data" + #PS$ + "Textures" + #PS$ + "smoke2.png")
LoadImage(3,#PB_Compiler_Home+"examples" + #PS$ + "3d" + #PS$ + "Data" + #PS$ + "Textures" + #PS$ + "flare.png")
LoadImage(4,#PB_Compiler_Home+"examples" + #PS$ + "3d" + #PS$ + "Data" + #PS$ + "Textures" + #PS$ + "sky.png")
LoadImage(5,#PB_Compiler_Home+"examples" + #PS$ + "3d" + #PS$ + "Data" + #PS$ + "Textures" + #PS$ + "nvidia" + #PS$ + "dirt_grayrocky_diffusespecular.jpg")
LoadImage(6,#PB_Compiler_Home+"examples" + #PS$ + "3d" + #PS$ + "Data" + #PS$ + "Textures" + #PS$ + "nvidia" + #PS$ + "dirt_grayrocky_normalheight.jpg")
LoadImage(7,#PB_Compiler_Home+"examples" + #PS$ + "3d" + #PS$ + "Data" + #PS$ + "Textures" + #PS$ + "waternormal.png")

Re: Lib Screen (Sprite) (PB 6.10)

Posted: Sun May 19, 2024 1:30 pm
by benubi
Wow, now it works for me. Very impressive indeed!!

I had to laugh, you have even put a shader editor in it - that's a genius idea. :D

I thought about having to make such a helper tool to learn shader programming; now I can save the time and efforts. I suppose you know that shadertoy website/app.

It would be nice if there was a shader tool that would also take into account PureBasic/Ogre interfaces so that we can make funny "shader toys" and have a productive tool for the 3D engine. "Shaders are the future" (since, a while crocodile... but I am sloooooow) :lol:

Re: Lib Screen (Sprite) (PB 6.10)

Posted: Sun May 19, 2024 2:21 pm
by Caronte3D
benubi wrote: Sun May 19, 2024 1:30 pm It would be nice if there was a shader tool that would also take into account PureBasic/Ogre...
+1000

Re: Lib Screen (Sprite) (PB 6.10)

Posted: Mon May 20, 2024 9:29 pm
by pf shadoko
@AZJIO
I made some corrections for linux, can you tell me if it's ok?
can you give me the paths to “libGL.so” for your different linux versions, I'll test them all

@ benubi & Caronte3D
it's planned, but it will be a bit more complicated to use.

Re: Lib Screen (Sprite) (PB 6.10)

Posted: Mon May 20, 2024 11:45 pm
by AZJIO
I haven't tested it yet, but if you use IncludeBinary, it will allow you to compile a file that does not depend on external files

Code: Select all

DataSection
	img1:
	IncludeBinary #PB_Compiler_Home+"examples/3d/Data/Textures/water.png"
	img2:
	IncludeBinary #PB_Compiler_Home+"examples/3d/Data/Textures/smoke2.png"
	img3:
	IncludeBinary #PB_Compiler_Home+"examples/3d/Data/Textures/flare.png"
	img4:
	IncludeBinary #PB_Compiler_Home+"examples/3d/Data/Textures/sky.png"
	img5:
	IncludeBinary #PB_Compiler_Home+"examples/3d/Data/Textures/nvidia/dirt_grayrocky_diffusespecular.jpg"
	img6:
	IncludeBinary #PB_Compiler_Home+"examples/3d/Data/Textures/nvidia/dirt_grayrocky_normalheight.jpg"
	img7:
	IncludeBinary #PB_Compiler_Home+"examples/3d/Data/Textures/waternormal.png"
EndDataSection
CatchImage(1, ?img1)
CatchImage(2, ?img2)
CatchImage(3, ?img3)
CatchImage(4, ?img4)
CatchImage(5, ?img5)
CatchImage(6, ?img6)
CatchImage(7, ?img7)
I tried to translate the text into Russian, but it caused an error. Is it possible to support UTF8?

Code: Select all

  S_DrawText(8,0,"[F1] Редактировать шейдер")
  S_DrawText(8,60,"[Пробел] Следующий пример")
  S_DrawText(8,120,"[Esc] Выход")
  S_DrawText(8,180,"Используйте мышь",40)

Re: Lib Screen (Sprite) (PB 6.10)

Posted: Tue May 21, 2024 10:58 am
by moulder61
@pf shadoko

"I made some corrections for linux, can you tell me if it's ok?
can you give me the paths to “libGL.so” for your different linux versions, I'll test them all"

I'm using PB 6.04 but copied the missing images from 6.10/11.
As AZJIO said, the text is blue and upside down. You seem to have added a 4th texture too. :)

The paths to libGL.so on my Linux systems are:
Devuan - as you had originally /usr/lib/x86_64-linux-gnu/ - works OK
Void - /usr/lib/ and /usr/lib64/ - but only lib64 works
Arch - /usr/lib/ and /usr/lib64/ - very hit and miss, works in both sometimes, or not. It's a bit temperamental. Getting an error on line 722?

Moulder.

Re: Lib Screen (Sprite) (PB 6.10)

Posted: Tue May 21, 2024 5:51 pm
by pf shadoko
@ AZJIO
I know, but the aim is to propose the code on the forum so...

@ moulder61
strange
I made 2 changes:
- for the color problem:
line 144: If #PB_OS_Windows:rgb=#GL_BGR_EXT:rgba=#GL_BGRA_EXT:Else:rgb=#GL_RGB:rgba=#GL_RGBA:EndIf
try with if 0... and if 1...

- for y-coordinate inversion:
line 533: If #PB_OS_Windows:codevertex=ReplaceString(codevertex,"//invertv","vuv.y=1-vuv.y;"):EndIf
try with if 0... and if 1...