User avatar
Gavinmc42
Posts: 2074
Joined: Wed Aug 28, 2013 3:31 am

Re: Star Citizen on the Raspberry Pi?!

Mon Jun 25, 2018 2:03 am

Collision detection is a big step toward an engine :D
Even serious games can stuff that up.

Big engines like Unity are supporting Vulkan and Vulkan supports Windows, Linux, Android etc.
Because Android is OpenGLES one day Vulkan on Pi's and other SBC's.

OpenGL on Pi's is based on OpenGLES anyway.
Some Vulkan stuff is in the works for Pi's even now.
Hopefully the speed increase that Vulkan provides might translate to the VC4/5?

Because I do baremetal in Free Pascal on Pi's I have been looking at the Castle Games Engine and nxPascal.
These are mostly Windows, Linux but parts of them could be ported to bare metal.

Dependencies for OpenGL etc are driving me nuts trying to get stuff running on Pi's.
Games engines can have lots, OpenAL, SDL2, Open??, lib???-dev
Might have to learn it all on PC's first.

Decided an a small detour into WebGL as that has a more immediate use.
WebGL 1.0 uses OpenGLES 2 ;)
Most of my non web and web use for 3D is for data visualization not gaming.
Think data generated Terrain maps ;)
Data every minute for a month is about 44k points, which you have just proved double :D

This can be tested on Windows/Linux with Laz/FPC and Laz/FPC does work in Raspbian ;)
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
tipam
Posts: 83
Joined: Fri Dec 30, 2011 1:32 pm
Contact: Website

Re: Star Citizen on the Raspberry Pi?!

Mon Jun 25, 2018 6:49 am

Think data generated Terrain maps ;)
... I'm really hoping to add a terrain editing tool similar to Unity's ... I've done it before on the PC and have all the shape tools so it would be good to have such tools purpose built for RPi
Collision detection is a big step toward an engine :D
Even serious games can stuff that up.
Again, I was surprised how fast this performed in a 'relatively' complex environment ... collision detection for walking about can be simplified; only triangles on the XZ plane are considered (i.e. looking down).

Using triangle boundary checks the engine can quickly eliminate triangles the avatar isn't walking on.

Of course, forward movement of the avatar still has to be checked using ray-triangle intersection and this needs checking for feet and head positions.

User avatar
Gavinmc42
Posts: 2074
Joined: Wed Aug 28, 2013 3:31 am

Re: Star Citizen on the Raspberry Pi?!

Mon Jun 25, 2018 9:01 am

I found this in Pascal, so more more my type of code.
https://github.com/genericptr/Pas2JS-WebGL
http://wiki.freepascal.org/pas2js

Does WebGL so gaming in Browsers?
Very simple examples which is about my level to understand ;)
Simple enough to port to C++ if you want to do a C++ version.

Will be interesting to see if a Pi is fast enough to serve a Browser game to a PC or Android.
Multiplayer version?
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
tipam
Posts: 83
Joined: Fri Dec 30, 2011 1:32 pm
Contact: Website

Re: Star Citizen on the Raspberry Pi?!

Mon Jun 25, 2018 11:08 pm

Here's a video link to see the progress on collision detection, walking about the cargo bay ...

https://youtu.be/5mDFgthnW_k

Credit to lighthouse3d.com that provides excellent example code for working out the collisions using ray-triangle intersections ...

http://www.lighthouse3d.com/tutorials/m ... ersection/

User avatar
Gavinmc42
Posts: 2074
Joined: Wed Aug 28, 2013 3:31 am

Re: Star Citizen on the Raspberry Pi?!

Mon Jun 25, 2018 11:47 pm

It keeps getting better.
Don't smooth out the stairs too much it adds realism.
People have compliance in their limbs and head, a robot would see those bumps.

Just a tiny bit more and you have a first person shooter engine :D
Trying to remember but it looks like early to mid Quake graphics to me, better than Duke Nuken anyway ;)
Do you see the sky box looking out a window?
I can remember that from Doom, "hey look, there is an outside".

Now I really need to know, how did you make the 3D models and textures?
That needs tutorial videos too :D

Sure Quake etc have been ported to Pi's but they don't teach anyone how to code games like them.
These sorts of graphics are going to get people interested.
Kids could 3D their schools etc
That could lead to interests in Architecture, civil engineering, surveying, landscaping, even interior design, perhaps game coding etc.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
tipam
Posts: 83
Joined: Fri Dec 30, 2011 1:32 pm
Contact: Website

Re: Star Citizen on the Raspberry Pi?!

Tue Jun 26, 2018 6:46 am

Gavinmc42 wrote:
Mon Jun 25, 2018 11:47 pm
It keeps getting better.
Don't smooth out the stairs too much it adds realism.
People have compliance in their limbs and head, a robot would see those bumps.

Just a tiny bit more and you have a first person shooter engine :D
Trying to remember but it looks like early to mid Quake graphics to me, better than Duke Nuken anyway ;)
Do you see the sky box looking out a window?
I can remember that from Doom, "hey look, there is an outside".

Now I really need to know, how did you make the 3D models and textures?
That needs tutorial videos too :D

Sure Quake etc have been ported to Pi's but they don't teach anyone how to code games like them.
These sorts of graphics are going to get people interested.
Kids could 3D their schools etc
That could lead to interests in Architecture, civil engineering, surveying, landscaping, even interior design, perhaps game coding etc.
Yes, graphics look very dated at the moment! I'll be baking shadows/lighting into this particular model so it will look a lot more realistic (and of course implement the skybox)

As for making a modelling tutorial, I'd love to do that except I use an old version of 3DS Max! Blender is the obvious choice but it would take me a while to learn it :-(

You're right about the educational value ... being a teacher in the past there is great value for kids to work with this stuff - that's one of the reasons I want to make this code easy to use and quick to implement ... with lots of examples.

I started the Pi3D stuff a long time ago with that intention ... which Paddy, Tom (and others) have continued - much to their credit!!
(see https://github.com/pi3d/pi3d_demos and https://github.com/tipam/pi3d/)

User avatar
Gavinmc42
Posts: 2074
Joined: Wed Aug 28, 2013 3:31 am

Re: Star Citizen on the Raspberry Pi?!

Tue Jun 26, 2018 7:53 am

I started the Pi3D stuff a long time ago with that intention ... which Paddy, Tom (and others) have continued - much to their credit!!
(see https://github.com/pi3d/pi3d_demos and https://github.com/tipam/pi3d/)
One of the firs things in 3D I tried years ago, perhaps I am not a tank or cathedral guy ;)

Since then I have done just enough FreeCAD and read lots of book to get my head around it.
Also needed to find out OpenVG was not that hard therefore OpenGLES may not be that hard either ;)
For me it was looking at anobj file and comparing it to a OpenGLES vector array.
Someone should show that, it was the missing link for me.

https://www.bforartists.de/
Easier than Blender? Worth a shot
Blender is good and free but no one likes learning on it ;)

Wow, two boxes and a cylinder in 10secs, I think I am in love :lol:
bfoartists ;) I wonder if it will run on a Pi's?
Ok make obj - tick
Texture mapping, hmm- GIMP?

I use FreeCAD because I made a box in <10secs without reading a manual, doing a training course or watching a Video.

A google - some people say Wings3D is a nice place to start.
Will it compile on Pi's?
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
Gavinmc42
Posts: 2074
Joined: Wed Aug 28, 2013 3:31 am

Re: Star Citizen on the Raspberry Pi?!

Tue Jun 26, 2018 11:39 am

Watched the video of the difference between Bforartists and Blender.
https://www.reddit.com/r/blender/commen ... orartists/

Now bleeding obvious why Blender never clicked with me.
Blender uses hot keys, probably very effective when you memorize them.
Bforartists is more for click mouse button users but with same Blender functions underneath a nicer UI.

I'm left handed (a higher percentage of Artists are lefties).
I use mouse with left hand, keyboard with right and I am a click/paste programmer.
Day job is designing circuit boards with Altium,which is mouse driven with STEP files for 3D.

I was making shapes and moving them around in seconds :D
Took me about 15 minutes to design the basics of my Steampunk Zeppelin.
The advantage is I had designed this before in Povray ;)
CPU Rendering is so slow, 20 minutes, really need a faster PC, than a Celeron Core Duo ;)
Or do it in OpenGLEs on a Pi :lol:

Anyway Bforartists works for me, very quick to make basic shapes
Need to read manual for textures and colours etc.
Attachments
catblimpbfor2.png
catblimpbfor2.png (99.34 KiB) Viewed 635 times
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
Gavinmc42
Posts: 2074
Joined: Wed Aug 28, 2013 3:31 am

Re: Star Citizen on the Raspberry Pi?!

Tue Jun 26, 2018 12:29 pm

Whoops, the is an OpenGLES render option, fractions of a second.
Time to RTFM :lol:
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
paddyg
Posts: 2150
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: Star Citizen on the Raspberry Pi?!

Wed Jun 27, 2018 10:28 am

Tim, this is looking really impressive and will be stunning with baked shadows.

Are you searching all the triangles in the collision object for intersections or have you used some kind of indexing? In my rust version of pi3d experiment I started out iterating through the whole elevation map but, as it's a uniform grid, put in a jump to the relevant element. It occurred to me at the time that it might be better to use a more general system of indexing but that would also be messy if the mesh moves and rotates, as presumably your cargo hold does (or do you freeze it once you're inside?).

Did you ever get anywhere with building sdl2 to use the broadcom drivers directly?

Blender is a bit of a beast but I think the more recent versions are more accessible. Everything that the pundits do using masonic secret key combinations is available through menus and an online search generally points you in the right direction (rather than at a five year old version).
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

User avatar
Gavinmc42
Posts: 2074
Joined: Wed Aug 28, 2013 3:31 am

Re: Star Citizen on the Raspberry Pi?!

Wed Jun 27, 2018 1:28 pm

Tim, this is looking really impressive and will be stunning with baked shadows.
What are you talking, about it's bleeding amazing now ;)
This is not the latest Nvidia GPU, this in done on a Pi, even works on Zero's.

Maybe we are too old and can remember what the old 3d stuff looks like from the 1990's.
Blender is a bit of a beast but I think the more recent versions are more accessible. Everything that the pundits do using masonic secret key combinations is available through menus and an online search generally points you in the right direction (rather than at a five year old version).
Yep tried many, many times to learn it. lucky for me, Bforartists made a new UI for Blender.
Still too complicated, so many options and the older Linux version I did that Zep on has bugs.
Hit the wrong button or keyboard I end up in weird menus, too many times.
The back button need to be bigger and flashing, er is there a undo button?

This maybe ready for Pi porting soon?
https://godotengine.org/article/gles2-a ... s-report-6

We really need something simple to learn for the kids to code 3D content/games with.
If it also made games for Smartphones/Tablets 8-)
If it is simple, the old man might be able to keep up ;)

The flat game designs seem to be in now, photorealist is for us old gamers.
Flat designs also work faster on OpenGLES mobiles, less polygons and textures.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
paddyg
Posts: 2150
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: Star Citizen on the Raspberry Pi?!

Wed Jun 27, 2018 3:26 pm

@Gavinmc42 you have to factor in grudging Yorkshire understatement!

I was dissuaded from even trying bforartists because of the lack of linux. And I've just about got the hang of some of blender so I need to keep using that so I don't forget it! ctrl-z is your friend (as in all sane applications) I use it about every tenth action in blender.

Interesting link to godot. I did quite a bit of experimentation with it a year ago and quite liked it but stopped when v3.0 was being touted - but not yet released. I decided that unity would be more comprehensive and multi-platform but maybe they're too big to be bothered with targeting RPi. That and the fact that I'd already used unity and c# previously. The open source nature of godot means that it's more likely to get niche enhancements and modifications so may be a better bet.

2Dv3D: there is scope for more action if textures are drawn as sprites to vertices (as in this or this) and physics and collisions are obviously quicker to calculate. But in python the vertex array really has to be recalculated with numpy so having an easy to code wrapper would be essential for everyday messing around kind of use.
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

User avatar
tipam
Posts: 83
Joined: Fri Dec 30, 2011 1:32 pm
Contact: Website

Re: Star Citizen on the Raspberry Pi?!

Wed Jun 27, 2018 9:14 pm

paddyg wrote:
Wed Jun 27, 2018 10:28 am
Tim, this is looking really impressive and will be stunning with baked shadows.

Are you searching all the triangles in the collision object for intersections or have you used some kind of indexing? In my rust version of pi3d experiment I started out iterating through the whole elevation map but, as it's a uniform grid, put in a jump to the relevant element. It occurred to me at the time that it might be better to use a more general system of indexing but that would also be messy if the mesh moves and rotates, as presumably your cargo hold does (or do you freeze it once you're inside?).

Did you ever get anywhere with building sdl2 to use the broadcom drivers directly?
Hi Paddy ... I am searching all the triangles but in a simplified collision model (around 700 collision tris instead 12k tris for the visible version of the cargo bay) .. also the floor collision function quickly eliminates triangles using a fast XZ bounds check. However, I should eliminate triangle groups to speed things up.

As for baking, I'll also try 'baked shadows' blended with tiled textures for a higher resolution effect.

I'm afraid I didn't get time to try a non-X11, broadcom version of SDL2 - if anyone is up to that I'd love to try it!

User avatar
Gavinmc42
Posts: 2074
Joined: Wed Aug 28, 2013 3:31 am

Re: Star Citizen on the Raspberry Pi?!

Thu Jun 28, 2018 3:49 am

I was dissuaded from even trying bforartists because of the lack of linux. And I've just about got the hang of some of blender so I need to keep using that so I don't forget it! ctrl-z is your friend (as in all sane applications) I use it about every tenth action in blender.
Good to know, better than redoing things 10 times.
Even BforA has two many options to make it easy to learn and finger slips cause pain.
Yep the current old Linux version has bugs too.

I might give Godot a go, at 20MB even I could probably compile that ;)

Is that 6000 3D Raspberries? really impressive plus ;)
I was happy just getting one baremetal animated mouse cursor working last year.

One reason I like Ulitbo is Pascal is native array aware, no numpy needed.
I started years ago with Pi + Python + PyGame, which has SDL, Numpy, smbus(i2c) etc.
Some PC based Delphi/Free Pascal units compile and just work on Ultibo without mods.

SDL seems to be the killer dependency for modelers, games and game engines.
I look at the engines and dig deep enough and SDL is there looking back sticking it's tongue out :lol:
Hmm, better check Godot.

Just tried to make the same Zeppelin in FreeCAD, a program I know really well, not easy at all, BforA is better :o
Well for modeling not CAD, FreeCAD gives me millimeter actual sizing.
Time to stop talking and start coding, this is looking like fun :D
.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
Gavinmc42
Posts: 2074
Joined: Wed Aug 28, 2013 3:31 am

Re: Star Citizen on the Raspberry Pi?!

Thu Jun 28, 2018 5:32 am

Godot is NOT a 3D modeler, you import 3D models and animate them in the game engine.
Google time.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
paddyg
Posts: 2150
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: Star Citizen on the Raspberry Pi?!

Thu Jun 28, 2018 12:47 pm

gavin, I suspect 3D modeling is always going to be either overwhelming or limited in some way. Are you wanting to do the actual modeling on the RPi? Have you tried sketchup? or Tinkercad which runs in browser and seems easy enough - but aimed at 3D printing so no uv mapping. Might be best to bite the bullet and overcome Blender! At least once you've mastered it you won't need to learn anything else.

Ultibo looks quite interesting but I'm not sure it has very accessible opengles functionality, couldn't see any examples.

tim, yes the speed of compiled programs checking down an array is so fast it might not need any indexing, especially with a lower poly collision mesh. I might have a go at compiling SDL2 on the RPi but not till next week.
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

User avatar
Gavinmc42
Posts: 2074
Joined: Wed Aug 28, 2013 3:31 am

Re: Star Citizen on the Raspberry Pi?!

Thu Jun 28, 2018 1:15 pm

Might be best to bite the bullet and overcome Blender! At least once you've mastered it you won't need to learn anything else.
I was coming to the same conclusion, lots of googling and nothing else comes close to Blender/BforA.

The few GLES examples have a cube, swapping a bigger array of vectors in maybe all that is needed.
https://github.com/ultibohub/Examples/t ... V/OpenGLES
Hope to find some time on the weekend to try it ;)

The Castle Games Engine has some interesting Utilities that might port, 3D viewer etc.
Godot looks like it could make simple engine.
All the pieces now seem to be in place, just needs some time to splice it all together.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
tipam
Posts: 83
Joined: Fri Dec 30, 2011 1:32 pm
Contact: Website

Re: Star Citizen on the Raspberry Pi?!

Thu Jun 28, 2018 11:11 pm

OK - I managed to get 3DSMax output a couple of baked textures (very rough) and here's the results ... (BTW, I had to kill the lighting in the shader so it sped things up quite a bit :P )

Image

Image

I also generated the baked lightmaps as well which means I can blend lightmaps with tiled textures to get a higher quality image - next thing on my list! Quite a few of the textures haven't been baked yet, so they will look very flat!

User avatar
Gavinmc42
Posts: 2074
Joined: Wed Aug 28, 2013 3:31 am

Re: Star Citizen on the Raspberry Pi?!

Fri Jun 29, 2018 2:12 am

You might now be getting a bit picky ;)
I had to compare those with the older pics to spot any difference.

Probably now is the time to think about graphics detail options switches.
I had to google to find the right words.
https://www.lifehacker.com.au/2013/02/g ... -settings/

As these are PC game setting etc, how many apply to the Pi's VC4 GPU?
Pi's can do 320x240 to 2560x1440, even on PC's I still play games in 800x600 windowed.

Getting interesting to see how far you can push the VC4.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
tipam
Posts: 83
Joined: Fri Dec 30, 2011 1:32 pm
Contact: Website

Re: Star Citizen on the Raspberry Pi?!

Fri Jun 29, 2018 6:38 am

Gavinmc42 wrote:
Fri Jun 29, 2018 2:12 am
You might now be getting a bit picky ;)
I had to compare those with the older pics to spot any difference.
... as I said its a very rough baking! ... none of the detail comes out for the flooring and the walls are a bit blurry - plus the light is way over saturated at some points. When it's finished, I'll balance the lighting and only use shadow maps with tiled textures - this should look considerably better!

What's great about baking is I don't do any light calcs for the baked sections which is considerably faster to render on the RPi.

User avatar
Gavinmc42
Posts: 2074
Joined: Wed Aug 28, 2013 3:31 am

Re: Star Citizen on the Raspberry Pi?!

Fri Jun 29, 2018 10:59 am

Google baking, a few YouTubes, oh that's baking ;)
Ok Blender bakes, seems to do a lot, which probably explains why people use it even with that insane UI.

In the old days you make 3D shapes and coloured them in, then someone figured out how to add textures.
Now it is about baking. I think I may need a few years Blendering.

Coding time.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
paddyg
Posts: 2150
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: Star Citizen on the Raspberry Pi?!

Fri Jun 29, 2018 7:10 pm

the best option is probably to have tiled textures with baked shadows then add phone style lighting with detailed normal map. However getting the fragment shader efficient, especially through the extra emulation layer, might take quite a bit of tweaking.
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

User avatar
tipam
Posts: 83
Joined: Fri Dec 30, 2011 1:32 pm
Contact: Website

Re: Star Citizen on the Raspberry Pi?!

Sat Jun 30, 2018 7:29 am

paddyg wrote:
Fri Jun 29, 2018 7:10 pm
the best option is probably to have tiled textures with baked shadows then add phone style lighting with detailed normal map. However getting the fragment shader efficient, especially through the extra emulation layer, might take quite a bit of tweaking.
... I'll probably go as far as tiled textures with baked shadows and some selective normal mapping - but, as you say, it will take a bit of tweaking! I will improve this scene, then move onto the rest of the ships geometry to complete it (one of my news years resolutions .. 'Finish it!' :lol: )

One thing I'd love to do (in code) is automate effects as much as possible (such as 'baked ambient occlusion mapping'
- see https://www.katsbits.com/tutorials/blen ... lusion.php for example) ... it's not easy baking textures but some good 'effects' can be achieved just through coding.

User avatar
paddyg
Posts: 2150
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: Star Citizen on the Raspberry Pi?!

Sat Jun 30, 2018 8:04 am

it is easier in Blender 2.79 than older verdon s. I even did some hacking on an addon https://m.youtube.com/watch?v=K1ThLRk1KZI
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

User avatar
Gavinmc42
Posts: 2074
Joined: Wed Aug 28, 2013 3:31 am

Re: Star Citizen on the Raspberry Pi?!

Tue Jul 03, 2018 2:19 am

Been Reading Blender books, Blender for Dummies etc.
Big Buck Bunny is ancient history 2008 :lol:
Wonder if something like that could be made entirely on Pi's?

I will need to go back to full size keyboard as Blender makes high usage of the number pad keys.
That was another duh! moment. Poor Mac users, only one mouse button :D
I use cut down keyboards so I can have more on my desk, Windows, Linux, 2 x Pi's= 4 keyboards.
No wonder I had trouble learning.

I did not realize how small Blender was in the early days ~ 1MB.
Can an earlier version be cut down and simplified and ported to Pi?
Since Blender uses OpenGL in it's UI then it may work in Gentoo64?

Blender also has a Game Engine, which is being dropped.
It may be usable for Pi's once OpenGL works well?
Could Blender be ported to use OpenGLES?

There is a raytracer called Yafaray that is compatible too.
Wonder if it can run on Pi's, make a low cost Render Farm?
https://github.com/YafaRay
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

Return to “OpenGLES”

Who is online

Users browsing this forum: No registered users and 3 guests