Recommended distribution to use Pi3d with odroid XU4

Post Reply
MrChang
Posts: 8
Joined: Thu Apr 11, 2019 7:22 am
languages_spoken: english
ODROIDs: xu4
Has thanked: 1 time
Been thanked: 0
Contact:

Recommended distribution to use Pi3d with odroid XU4

Unread post by MrChang » Fri May 03, 2019 11:11 pm

I'm using Pi3d to show OBJ models. With the same code I get the following results in a laptop, a raspberry and an odroid xu4

Laptop
windows 8.1
pi3d v2.29
Intel (R) HD Graphics 5500
OpenGL 4.3
OpenGL ES: ?
Image

Odroid XU4
Ubuntu 18.04 Mate
fbturbo: No
mali-x11
GL_RENDERER: Mali-T628
GL_VERSION: OpenGL ES 3.1 (glmark-es); OpenGL ES 3.0, Mesa 18.0.5, GLSL ES 3.00 (glxinfo)
Image

Raspberry 3 model B
GL_VERSION: OpenGL ES 3.0, Mesa 13.0.0, GLSL ES 3.00 (glxinfo)
Image

As you can see some parts of the model shown in the odroid turn black and the model has solid colors with no gradient. I was doing some research but yet I'm not sure what causes this problem, I was wondering if there is a specific OS distribution for the odroid xu4 in which this problem doesn't happen?

I don't know if this will be useful but I will give more information, the raspberry had the opengl driver disabled, the odroid ran correctly all models in the glmark-es test with a score of 332, when using the command glxinfo | grep -i opengl in the odroid the first four lines are errors:

Code: Select all

MESA-LOADER: failed to retrieve device information
libGL error: unable to load driver: exynos_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: exynos
If there is no distribution in which this is solved I would like to know how can I fix this. Thank you for your time

User avatar
meveric
Posts: 10389
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1, N1, Go, H2 (N4100), N2
Has thanked: 15 times
Been thanked: 117 times
Contact:

Re: Recommended distribution to use Pi3d with odroid XU4

Unread post by meveric » Sat May 04, 2019 5:40 am

glxinfo uses MESA OpenGL drivers which do not exist for ODROIDs.
Try es2_info instead.

aside from that I tried pi3d on my OGST image and it was working fine.
I don't have that particular demo you have, but I tried the demos from https://github.com/pi3d/pi3d_demos and they pretty much all worked fine.
If you can share your particular test I can try it.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.

MrChang
Posts: 8
Joined: Thu Apr 11, 2019 7:22 am
languages_spoken: english
ODROIDs: xu4
Has thanked: 1 time
Been thanked: 0
Contact:

Re: Recommended distribution to use Pi3d with odroid XU4

Unread post by MrChang » Sat May 04, 2019 7:25 am

Thank you meveric for taking your time to test it, I already downloaded your image and I will try it soon, this is the version I have :
ODROID-GameStation-Turbo-3.9.6-20180619-XU3+XU4-Jessie.img

If the demos are working fine for you most probably this is the solution I was looking for, this is the code that I used:

Code: Select all

import demo
import pi3d

# pi3d setup
set_fullscreen = 1

if set_fullscreen > 0:
    use_pygame=True
    DISPLAY = pi3d.Display.create(background=(1.0, 1.0, 1.0, 1))
else:
    DISPLAY = pi3d.Display.create(x=0, y=0, w=900, h=600, frames_per_second=60)
    DISPLAY.set_background(0.1, 0.1, 0.1, 1.0) # r,g,b,a

shader = pi3d.Shader("uv_reflect")
pi3d.Light(lightpos=(0.0, 0.0, -1.0), lightcol=(0.8, 0.8, 0.85), lightamb=(0.1, 0.1, 0.1))
pi3d.opengles.glDisable(pi3d.GL_CULL_FACE)
CAMERA = pi3d.Camera(is_3d=False)
W = DISPLAY.width
H = DISPLAY.height

# load model OBJ-MTL with JPG texture
z0 = 1000.0
shape_1 = pi3d.Model(file_string='models/pi3d.obj', name='model_1', z=z0)
texture = pi3d.Texture("models/pi3d.jpg")
shape_1.set_draw_details(shader,[texture])
sFx = sFy = sFz = 300.0
shape_1.position(0.0,0.0,z0)
shape_1.scale(sFx, sFy, sFz)

n = 0

while DISPLAY.loop_running():

    shape_1.rotateIncY(-4.41)
    shape_1.rotateIncZ(-4.12)
    shape_1.rotateIncX(-4.23)
    shape_1.draw()

    n = n + 1
    if n >= 1000:
        break

DISPLAY.destroy()
The model used is in the pi3d demos folder "models", but I had some issues with the texture image "pi3d.jpg", I had to apply a mirror respect to the horizontal axis to match up it with the model.

User avatar
meveric
Posts: 10389
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1, N1, Go, H2 (N4100), N2
Has thanked: 15 times
Been thanked: 117 times
Contact:

Re: Recommended distribution to use Pi3d with odroid XU4

Unread post by meveric » Sat May 04, 2019 5:44 pm

sadly testing your code, results in the same black spots... none of the other tests show something like this.
I played around with the code a little and apparently the shader seems to be the issue. My guess the Mali drives that handle the shader are not that good.
If you exchange uv_reflect with uv_light it looks a lot better.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.

MrChang
Posts: 8
Joined: Thu Apr 11, 2019 7:22 am
languages_spoken: english
ODROIDs: xu4
Has thanked: 1 time
Been thanked: 0
Contact:

Re: Recommended distribution to use Pi3d with odroid XU4

Unread post by MrChang » Sun May 05, 2019 12:46 am

Those are bad news... thank you for spotting that issue with the shaders. I will look for more info about Mali drives to see if there is something I can do!

MrChang
Posts: 8
Joined: Thu Apr 11, 2019 7:22 am
languages_spoken: english
ODROIDs: xu4
Has thanked: 1 time
Been thanked: 0
Contact:

Re: Recommended distribution to use Pi3d with odroid XU4

Unread post by MrChang » Mon May 06, 2019 11:51 pm

If you exchange uv_reflect with uv_light it looks a lot better
I didn't try that at first, but when I did the results are far more than acceptable, the models are shown perfectly fine with uv_light instead of uv_reflect, this change fixed my problem, thank you so much meveric!

User avatar
meveric
Posts: 10389
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1, N1, Go, H2 (N4100), N2
Has thanked: 15 times
Been thanked: 117 times
Contact:

Re: Recommended distribution to use Pi3d with odroid XU4

Unread post by meveric » Tue May 07, 2019 12:33 am

No problem; It still means that some of the shaders are not working correctly or at least not as they work on other devices.

There are several other Demos that use uv_reflect in pi3d_demo repo which do not seem to have the issue, or at least I couldn't find them.
Maybe there's a way to fix the shader if some parameters are changed, but I haven't checked into that.

Afterall uv_light is kinda the opposite of uv_reflect, so not sure if that the desired outcome.
These users thanked the author meveric for the post:
MrChang (Tue May 07, 2019 1:21 am)
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.

MrChang
Posts: 8
Joined: Thu Apr 11, 2019 7:22 am
languages_spoken: english
ODROIDs: xu4
Has thanked: 1 time
Been thanked: 0
Contact:

Re: Recommended distribution to use Pi3d with odroid XU4

Unread post by MrChang » Tue May 07, 2019 1:21 am

Maybe it has something to do with pi3d.Camera(is_3d=False) to change the default perspective view to ortographic view, pi3d_demos that work fine like "LoadModelObj.py" doesn't use that, "Orbit.py" that uses ortographic view has the same problem of black spots.

In my case uv_light is interchangeable with uv_reflect.

Post Reply

Return to “Issues”

Who is online

Users browsing this forum: No registered users and 5 guests