Commit Graph

251 Commits

Author SHA1 Message Date
Erwin Coumans
1bd82e7d81 allow rendering of (textured) heightfield in TinyRenderer and EGL.
Also update normals, if heightfield is updated.
2020-09-20 16:03:56 -07:00
Erwin Coumans
1452cae641 * add textured models of ball.vtk (obj/mtl) and torus (obj/mtl) and cloth.
1) allow to render deformables in 'getCameraImage', for TinyRenderer (tested OK) and EGL (untested)
2) allow to have textures for deformables. See deformable_ball.py, deformable_anchor.py and deformable_torus.py for examples
3) deformables: allow to request simulation mesh data (even if there is a render mesh) See deformable_anchor.py for an example usage
   data = p.getMeshData(clothId, -1, flags=p.MESH_DATA_SIMULATION_MESH)
4) fix deletion of deformables, thanks to Fychuyan, https://github.com/bulletphysics/bullet3/pull/3048
5) allow to enable and disable double-sided rendering, p.changeVisualShape(objectUid, linkIndex, flags=p.VISUAL_SHAPE_DOUBLE_SIDED)
6) fix GripperGraspExample, model not found
7) Fix deformable anchor not attaching to multibody with object unique id of 0
8) Fix issue with assignment of unique ids in TinyRenderer/EGL renderer (always use broadphase uid)
9) Avoid crash/issue of simulation with pinned vertices (mass 0) in btDeformableBackwardEulerObjective::applyExplicitForce
10) Store uv/normal in btSoftBody::RenderNode to allow textured meshes
11) (uncomment in btSoftBodyHelpers.cpp): dump vertices and indices in obj wavefront format, when loading a VTK file, for quicker creation of a (textured) surface mesh
12) allow interpolateRenderMesh also for old position-based soft bodies (not only the shiny new FEM deformables)
13) fix a few premake targets
14) update build_visual_studio_vr_pybullet_double_cmake.bat so it suits c:\python37 and installs locally
    for local install of Bullet, see also this example https://github.com/erwincoumans/hello_bullet_cmake
2020-09-12 01:03:04 -07:00
Erwin Coumans
1190a1901c fix mipmap rendering from previous commit, making Macbook really slow 2020-09-08 13:04:50 -07:00
Erwin Coumans
ccdec68b1d expose shadowmap intensity to PyBullet API 2020-09-07 16:52:14 -07:00
Erwin Coumans
fc2378dda7 enable multisampling and mipmapping
ignore file:// as well as model:// and package://
add newline as additional delimiter for COLLADA DAE loader
2020-09-07 15:26:11 -07:00
David CARLIER
cbff4a0a06
Fix openglwindows example build on netbsd. (#3008)
not support for pthread_getconcurrency.
2020-08-27 06:55:50 -07:00
Erwin Coumans
0883aa06f3 fix OpenGL issue on Mac OSX, requiring a resize before drawing works ok. 2020-05-06 17:39:41 -07:00
Max Argus
5bd9e4ec9b improve EGL context creation 2020-04-07 20:38:41 +02:00
Erwin Coumans
d31c248751 fixes for compilation on Visual C++ for Python 9.0
bump up to PyBullet 2.6.9
2020-03-17 17:10:47 -07:00
vabr-g
dd8fcad6d8
Include dlerror() in handling of failed dlopen()
X11OpenGLWindow::X11OpenGLWindow() ends up calling dlopen() to get libX11.
When this fails, it only reports that it failed, and what filename it was looking for.
This commit adds dlerror() to the error message, which makes investigating failures easier.
2020-02-14 15:32:40 +01:00
Erwin Coumans
1be6a1d16b fix loadpanda video generation
remove duplicate code (formerly Windows ffpmeg needed different settings?)
2020-01-12 08:07:54 -08:00
Erwin Coumans
83bdef8254 add --mp4fps=30 command line parameter for ExampleBrowser (and using pybullet.connect(p.GUI, options="--mp4fps=30 --mp4=\"testvideo.mp4\"") 2020-01-11 12:19:42 -08:00
Erwin Coumans
763e25dd37 fix Mac Catalina pybullet build (setup.py) 2019-12-03 20:49:08 -08:00
Erwin Coumans
9ca957387f Deformables: enable double sided rendering, reduced the number of debug lines in regular rendering. 2019-11-12 20:08:49 -08:00
erwincoumans
96031789dd
Merge pull request #2315 from nbelakovski/nbelakovski/fix_mac_opengl
Call drawRect on Mac to fix OpenGL issue
2019-07-09 08:39:41 -07:00
nbelakovski
3b4831089b
Call drawRect on Mac to fix OpenGL issue
This fixes an issue on Mac where an OpenGL window doesn't show anything until it is resized.
2019-07-06 20:34:22 -07:00
erwincoumans
9e28737b57
Merge pull request #2298 from erwincoumans/master
configureDebugVisualizer: expose lightPosition, shadowMapResolution (texture resolution) and shadowMapWorldSize
2019-06-19 11:48:25 -07:00
erwincoumans
d762bc4e84
Merge pull request #2266 from devnexen/shader_example_build_fix
Fix shader example build / spotted by clang
2019-06-19 09:16:25 -07:00
Erwin Coumans
c3b7f39aaf expose shadowMapResolution (texture resolution) and shadowMapWorldSize (size in meters in world space)
expose pybullet.ConfigureOpenGLVisualizerRequest(lightPosition=[x,y,z], shadowMapWorldSize=10.5, shadowMapResolution=16384)
See examples/pybullet/examples/configureDebugVisualizer.py for an example.
This reimplements https://github.com/bulletphysics/bullet3/pull/2295 but without creating a new command/status and explicitly referring to the debug visualizer
(since the 'getCameraImage' also has a lightPosition)
2019-06-19 09:01:16 -07:00
Erwin Coumans
6160b52fd7 graphicsServer to workaround OpenGL issues on some servers. 2019-06-13 23:24:22 -07:00
David Carlier
66c4e20fd2 Fix shader example build / spotted by clang 2019-05-23 20:40:29 +01:00
erwincoumans
12e6478689
Merge pull request #2103 from erwincoumans/master
PyBullet deep_mimic backflip re-using original DeepMimic policy from Jason Peng
2019-02-11 05:45:21 -08:00
erwincoumans
9bddca873c allow pybullet_envs.deep_mimic.testrl --arg_file run_humanoid3d_backflip_args.txt to perform a backflip. Can only backflip twice, then drops on ground.
this deepmimic is still very slow, due to slow mass matrix/inverse dynamics computation. once spherical motor drive is enabled, it should be fast(er)
move pd_controller_stable to pybullet_utils for easier re-use
add plane_transparent.urdf to pybullet_data
allow spacebar in keyboardEvents (Windows for now)
2019-02-10 20:56:31 -08:00
erwincoumans
b574a360f5
Merge pull request #2055 from xantares/pybullet
Pybullet enhancements
2019-02-10 20:25:47 -08:00
erwincoumans
ae8e83988b Add preliminary PhysX 4.0 backend for PyBullet
Add inverse dynamics / mass matrix code from DeepMimic, thanks to Xue Bin (Jason) Peng
Add example how to use stable PD control for humanoid with spherical joints (see humanoidMotionCapture.py)
Fix related to TinyRenderer object transforms not updating when using collision filtering
2019-01-22 21:08:37 -08:00
Michel Zou
e9112a9f5f Install examples lib 2019-01-12 11:06:06 +01:00
erwincoumans
5e08808e69 Fix issue 1883, OpenGL 2.x doesn't have glGenerateMipmap 2018-12-22 11:42:29 -08:00
erwincoumans
bdda7af8d7 Use the kF_UseGjkConvexCastRaytest for more accurate picking
fix upAxis in some demos
2018-10-27 11:38:38 -07:00
erwincoumans
ed49edc1af PyBullet change API (since it was broken): pybullet_changeVisualShape with textureUniqueId ==-1 will clear the texture
b3InitUpdateVisualShape doesn't take textureUniqueId by default. new API b3UpdateVisualShapeTexture to change texture (-1 will clear texture)
PyBullet/BulletRobotics: allow to reset the textureUniqueId to -1, to clear a texture
PyBullet/BulletRobotics: save all texture handles
2018-10-20 15:56:56 -07:00
bla
7cd962467e fix EGL issue related to glViewport in startRender method 2018-10-01 18:51:02 -07:00
erwincoumans
bfafd9b0ae Merge branch 'master' of https://github.com/erwincoumans/bullet3 2018-09-30 20:02:32 -07:00
erwincoumans
6d89413336 scaling striding is 4 (scaling+object uid) instead of 3, also for transparent objects 2018-09-30 20:02:12 -07:00
erwincoumans
0ffa9a97bd scaling striding is 4 (scaling+object uid) instead of 3, also for transparent objects 2018-09-30 19:52:19 -07:00
Erwin Coumans
42ae4e81a8 apply clang-format (on Mac, slightly different than running it on Windows) 2018-09-30 11:43:57 -07:00
erwincoumans
5bcd43711a PyBullet OpenGL/EGL hardware getCameraImage: use glViewport to reduce the glReadPixels calling cost dramatically for small images
PyBullet Allow OpenGL/EGL hardware to render segmentation mask. Use pybullet.ER_SEGMENTATION_MASK_OBJECT_AND_LINKINDEX or pybullet.ER_SEGMENTATION_MASK
PyBullet.removeBody fix indexing bug (use foundIndex, not i)
PyBullet bump up version to 2.2.3
2018-09-30 07:10:40 -07:00
erwincoumans
ab8f16961e Code-style consistency improvement:
Apply clang-format-all.sh using the _clang-format file through all the cpp/.h files.
make sure not to apply it to certain serialization structures, since some parser expects the * as part of the name, instead of type.
This commit contains no other changes aside from adding and applying clang-format-all.sh
2018-09-23 14:17:31 -07:00
Erwin Coumans
b0971b4beb fix our internal build 2018-09-13 10:20:38 -07:00
erwincoumans
684a9f6a99 move stb_image/stb_image_write.cpp into a cpp file instead of random files with the magic 'STB_IMAGE_WRITE_IMPLEMENTATION' define
move setup.py back to eglRenderer extension, use pkgutil.get_loader('eglRenderer').get_filename()
disable dlmopen by default, unless B3_USE_DLMOPEN is defined.
2018-09-10 23:18:34 -07:00
erwincoumans
7369005402 pybullet, use eglPlugin statically instead of dynamic loading an Extension -DSTATIC_EGLRENDERER_PLUGIN
Fix compile errors of pybullet on Windows.
2018-09-09 15:23:26 -07:00
erwincoumans
adb5c049c7 Thanks to @dchichkov for some of the fixes in the eglRendererPlugin!
Rename tinyRenderer -> eglRenderer in the eglRendererPlugin.
Allow to run the eglRendererPlugin to run on Windows (not in EGL mode but Win32OpenGLWindow mode)

Here is a script I tested on Windows:
~~~~~~~~~~~~
mport pybullet as p
import time

p.connect(p.DIRECT)
plugin = p.loadPlugin("e:/develop/bullet3/bin/pybullet_eglRendererPlugin_vs2010_x64_debug.dll","_eglRendererPlugin")
print("plugin=",plugin)
p.setGravity(0,0,-10)
p.loadURDF("plane.urdf",[0,0,-1])
p.loadURDF("r2d2.urdf")
pixelWidth = 320
pixelHeight = 220
while (1):
	p.stepSimulation()
	viewMatrix = [1.0, 0.0, -0.0, 0.0, -0.0, 0.1736481785774231, -0.9848078489303589, 0.0, 0.0, 0.9848078489303589, 0.1736481785774231, 0.0, -0.0, -5.960464477539063e-08, -4.0, 1.0]
	projectionMatrix  = [1.0825318098068237, 0.0, 0.0, 0.0, 0.0, 1.732050895690918, 0.0, 0.0, 0.0, 0.0, -1.0002000331878662, -1.0, 0.0, 0.0, -0.020002000033855438, 0.0]

	#img_arr = p.getCameraImage(pixelWidth, pixelHeight, viewMatrix,projectionMatrix, shadow=1,lightDirection=[1,1,1])#,renderer=pybullet.ER_BULLET_HARDWARE_OPENGL)
	img_arr = p.getCameraImage(pixelWidth, pixelHeight, shadow=1,lightDirection=[1,1,1])#,renderer=pybullet.ER_BULLET_HARDWARE_OPENGL)
	#print("img_arr=",img_arr)
	time.sleep(1)
~~~~~~~~~~~~~
2018-09-09 13:37:49 -07:00
Max Argus
425ecbd3e6 fix cmake, linux only (patch egl) 2018-08-30 13:24:25 +02:00
Max Argus
964a5116eb fix cmake + apple (patch egl) 2018-08-30 13:24:25 +02:00
Max Argus
902818894c fix cmake (patch egl) 2018-08-30 13:24:25 +02:00
Max Argus
05f82e8867 egl plugin working 2018-08-30 13:24:25 +02:00
Max Argus
f80f0c76a4 added egl plugin commit 2018-08-30 13:24:25 +02:00
Max Argus
1b95961617 fix build 2018-08-30 13:24:25 +02:00
Max Argus
a9ba3eb8cc fixed cmake 2018-08-30 13:24:25 +02:00
Max Argus
f0e7f266ef switched to new glad2 2018-08-30 13:24:25 +02:00
Max Argus
5dbf2373ad load gl with egl not glx 2018-08-30 13:24:25 +02:00
Max Argus
5e8ee98f2e fix OpenGL3App argument order 2018-08-30 13:24:25 +02:00