Showing posts with label OpenGL. Show all posts

OpenGL ES with Raspberry PI





+ you need to have rootfs of RPI on host, openg es framework on RPI rootfs /opt/vc/lib folder
+ source code get from here
   - change SDKSTAGE in Makefile to your RPI'rootfs
+ build app as bellow

#source build environment
TOOLCHAIN_DIR=/opt/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64
export PATH=$PATH:${TOOLCHAIN_DIR}/bin

#build
make

#copy to boar via scp command on host
scp -r your_opengles_app_on_host pi@192.168.1.3:/home/pi/

#terminal on RPI
export LD_LIBRARY_PATH=/opt/vc/lib
run_your_opengles_app



Sunday, October 15, 2017

Lập trình OpenGL/ES cơ bản



Download examples source code
- LinuxX11
- GLES2.0
Download here

OpenGL ES 2.0 and GLSL
OpenGL ES 2.0 API Quick Reference Card
The OpenGL® ES Shading Language
OpenGL ES 2.0 Reference Pages

Contents
- Vertex/fragment shader
- Vertex and Texcoord
- Texture
- Program object
- Draws
- Viewport
- MVP matrix
- Transform
- Render 3D object

Project
- Car cluster display



Saturday, October 3, 2015
Tag :

Ứng dụng OpenGL Helloworld

Download examples source code
LinuxX11
- GLES2.0

Ở phần này chúng ta sẽ xem các ví dụ sử dụng OpenGL ES 2.0
OpenGL ES 2.0 API Quick Reference Card
The OpenGL® ES Shading Language
OpenGL ES 2.0 Reference Pages


Note: Để build và chạy được các ví dụ dưới đây các thư viện OpenGL và liên quan cần được install trước, xem lại tại đây.

LinuxX11 examples:
 $ make  
 $ cd Chapter_2/Hello_Triangle/  
 $ ./CH02_HelloTriangle   
  122 frames rendered in 2.0049 seconds -> FPS=60.8524  
  120 frames rendered in 2.0098 seconds -> FPS=59.7080  
  120 frames rendered in 2.0148 seconds -> FPS=59.5586  
  119 frames rendered in 2.0032 seconds -> FPS=59.4038  





GLES2.0 examples:
 $ make -f Makefile.x11  
 $ cd 01_SimpleTriangle/  
 $ ./01_SimpleTriangle  



Install OpenGL/ES trên Linux PC (Linux X11)

Trong bài viết này hướng đẫn việc install OpenGL trên máy tính

 yum install -y mesa-libEGL-devel mesa-libGLES-devel opencl-headers.noarch libX11-devel libpng-devel  
 yum install -y opencl-headers.noarch  
 yum install -y libX11-devel libpng-devel  
    
 echo DISPLAY=:0.0  

Trên máy tính OpenGL có thể sử dụng được cả libX11 lẫn EGL để interface, quản lý của sổ với OpenGL, tuy nhiên trên các thiết bị nhúng thì chỉ có thể sử dụng EGL mà thôi.



Giới thiệu OpenGL, OpenGL ES 2, EGL



OpenGL là một thư viện đồ họa 2D, 3D tương tự như DirectX (Direct3D), hiện được quản lý và phát triển bởi Khronos Group.
OpenGL ES là phiên bản rút gọn để có thể chạy được trên các thiết bị nhúng như điện thoại, máy chơi game, ...
EGL là một interface giữa OpenGL|ES và Kernel



Việc lập trình đồ họa sử dụng những API thuần của OpenGL khá phức tạp và mất thời gian nên người ta đã tạo nên các toolkit để wrap các API của OpenGL như QT, GLFW, freeglut, wxWidgets




Để chạy được OpenGL đòi hỏi board phát triển của chúng ta phải có GPU, thư viện OpenGL|ES và EGL thường được nhà phát triển board tích hợp sẵn vào bộ SDK (Rootfs) để người dùng sử dụng luôn.

OpenGL|ES sử dụng một ngôn ngữ gọi là OpenGL ES Shading Language (GLSL) để điều khiển GPU.


- Copyright © Lập trình hệ thống nhúng Linux . Powered by Luong Duy Ninh -