Commit Graph

88 Commits

Author SHA1 Message Date
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
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
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
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
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
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
Max Argus
05f82e8867 egl plugin working 2018-08-30 13:24:25 +02:00
Erwin Coumans
77c332bd88 PyBullet: add option to cache graphics shapes for URDF files, handy for benchmarks with many duplicate robots
See https://github.com/erwincoumans/pybullet_robots ANYmal.py for an example.
PyBullet: Expose p.setPhysicsEngineParameter(solverResidualThreshold=1e-2) (b3PhysicsParamSetSolverResidualThreshold), increases solver performance a lot
PyBullet: Expose p.setPhysicsEngineParameter(contactSlop) Set it to zero, to avoid issues with restitution.
PyBullet: Expose isNumpyEnabled, return True is PyBullet was compiled with NUMPY support for 'getCameraImage'.
PyBullet: Expose p.ChangeDynamics(objectUid, linkIndex, contactProcessingThreshold), to avoid issues of speculative/predictive contacts with restitution.
See also http://twvideo01.ubm-us.net/o1/vault/gdc2012/slides/Programming%20Track/Vincent_ROBERT_Track_ADifferentApproach.pdf
2018-05-23 13:26:00 +10:00
erwincoumans
034dfba3ae fix VR controllers only visible in one eye (remove stray glClear for testing planar reflection)
PyBullet: force both contactStiffness and contactDamping (report error otherwise)
2018-05-16 14:24:12 -07:00
erwincoumans
c2869e0a3c enable planar reflection in minitaur_gym_env.py and locomotion scenes 2018-04-11 08:50:29 -07:00
erwincoumans
ffc808784b PyBullet: add planar reflection example,
See examples/pybullet/examples/addPlanarReflection.py
2018-04-11 01:03:36 -07:00
yunfeibai
6b97e1e604 Expose API to set projective texture instead of using global. 2018-03-20 21:28:47 -07:00
yunfeibai
37696dd87e Add Bullet C API and pybullet API to set projective texture matrices. 2018-03-18 18:45:54 -07:00
yunfeibai
fd7aa8d0e1 Expose using projective texture as a flag in pybullet getCameraImage API. 2018-03-18 17:01:23 -07:00
erwincoumans
90b34680b0
Merge pull request #1572 from erwincoumans/master
explicitly remove textures during resetSimulation
2018-02-22 08:37:03 -08:00
erwincoumans
73a4334e30 explicitly remove textures during resetSimulation
move glViewport to Win32Window
2018-02-21 23:22:16 -08:00
erwincoumans
3508a4523b
Merge pull request #1560 from YunfeiBai/master
Add shader and example for projective texture.
2018-02-21 10:23:18 -08:00
Erwin Coumans
b0984de046 preparation to replace glew by glad 2018-02-20 19:44:02 -08:00
yunfeibai
5494aa72fa Set the perspective projection for projective texture mapping. Change the demo to two bears with the same view projection matrix for the camera and the projector. 2018-02-20 18:32:09 -08:00
erwincoumans
01f58f8f02 PyBullet: soft bodies are rendered, so we don't need to also render wireframes in regular mode.
Use glBufferSubData instead of glMapBuffer/glUnmapBuffer, much faster soft body vertex sync.
Don't use a separate btSoftBodyWorldInfo, use the existing one in btSoftMultiBodyDynamicsWorld.
2018-02-18 11:09:42 -08:00
yunfeibai
fb6907aa1b Merge remote-tracking branch 'upstream/master' 2018-02-15 18:19:29 -08:00
yunfeibai
36dcabbaf5 Merge remote-tracking branch 'upstream/master' 2018-02-15 14:31:34 -08:00
yunfeibai
cf4a0a3503 Add improvement/fix in SortableTransparentInstance back. 2018-02-15 13:19:41 -08:00
yunfeibai
2947cd54ce Add shader for projective texture. 2018-02-11 21:29:02 -08:00
yunfeibai
08548e1ef0 Add example for projective texture. 2018-02-11 13:50:45 -08:00
Erwin Coumans
dcdec2236f PyBullet/rendering: improve sorting of transparent objects 2018-02-05 23:48:39 -08:00
erwincoumans
13d67e8fc3 add bicycle resources and testBike.py script (use python -m pybullet_envs.examples.testBike after pip install pybullet)
center shadow around camera target
2018-01-31 22:17:15 -08:00
Erwin Coumans
e97b751781 further work on urdfEditor.py, fix some serialization issues 2018-01-08 12:25:56 -08:00
Erwin Coumans
26d32f2aa8 improve loading performance of large textures:
option to disable tinyrenderer, use p.configureDebugVisualizer(p.COV_ENABLE_TINY_RENDERER,0)
also make sure to use p.configureDebugVisualizer(p.COV_ENABLE_RENDERING,0) before loadURDF, and enable rendering afterwards using p.configureDebugVisualizer(p.COV_ENABLE_RENDERING,1)
reorder 2 loops, making the flip texels twice as fast (cache coherency),
single memcpy of entire texture in tinyrenderer, instead of per-pixel copy (memory layout is the same)
add lots of B3_PROFILE timings, to see where time is going
2017-10-06 13:46:24 -07:00
erwincoumans
e0dbd25cb7 remove some unneeded/debug BT_PROFILE markers 2017-09-29 07:50:48 -07:00
erwincoumans
6d68a67c79 fix a bug in a changeVisualShape/texture selection, out-of-bounds check was using the wrong array.
May fix some internal texture mug bug.
2017-09-25 11:11:48 -07:00
erwincoumans
390f111547 enable option to use GLFW, instead of our own cross-platform X11/Cocoa/Windows OpenGLWindow classes 2017-09-19 21:10:54 -07:00
Erwin Coumans
9cf747b35b a few compile/warning fixes 2017-07-01 10:01:55 -07:00
Erwin Coumans
c17625a4d0 texture check fix 2017-07-01 09:15:00 -07:00
Erwin Coumans
88897cc744 implement pybullet.changeTexture. For now, the width/height has to match the target texture unique id, otherwise crashes may happen (a check for width/height match will be added)
See also examples\pybullet\examples\changeTexture.py
2017-06-30 19:11:43 -07:00
Erwin Coumans
dd3d55610b fixes in pybullet.loadTexture, changeVisualShape replacing texture.
(also works for OpenGL3 renderer now)
2017-06-30 13:35:07 -07:00
erwincoumans
d5fe67cf57 Add pybullet transparent.py example, transparency with global per-object sort in GLInstancingRenderer 2017-06-24 19:38:31 -07:00
erwincoumans
a651cb9ab4 Implement first pass of transparent graphics object for GLInstancingRenderer
remove 'enableBlend' from API, graphics instances use alpha component instead
fix forward axis for SimpleCamera
2017-06-24 13:41:33 -07:00
Erwin Coumans
9e5e0da9f4 move stb_image/stb_truetype.h and stb_image/stb_image_write.h to ThirdPartyLibs/stb_image folder 2017-06-22 08:48:18 -07:00
Erwin Coumans
030d723db6 fix some warnings 2017-06-01 16:48:07 -07:00
Erwin Coumans
5c6045b61f turn down effect of default specular a bit 2017-06-01 13:15:58 -07:00
Erwin Coumans
87293e835c implement specular, URDF non-standard specular part (see sphere2.urdf) and SDF specular support.
pybullet.changeVisualShape(obUid,linkIndex,specularColor=[R,G,B]) and Bullet C-API b3UpdateVisualShapeSpecularColor
Bug fixes in b3ResourcePath::findResourcePath resolution.
add stadium.sdf and roboschool/models_outdoor/stadium assets https://github.com/openai/roboschool/tree/master/roboschool/models_outdoor/stadium
minor fixes to obj2sdf
2017-06-01 12:32:44 -07:00
Erwin Coumans
3157093125 Implemented specular reflective lighting for OpenGL 3.x, everything looks shiny (will add APIs to make it less shiny ;-)
Remove roof from kitchens/1.sdf, otherwise shadows and shinyness won't work (light is outside the room, bouncing against roof-top)
Make kuka_iiwa/model.urdf more smooth, use .obj for per-vertex normals (using Blender, import STL, export OBJ, enable triangles, normals and Z-UP, Y forward)
2017-05-31 20:32:45 -07:00
erwincoumans
4e03c36fa6 add pybullet.multiplyTransforms and pybullet.invertTransform
use btAssert instead of assert (glGetError is really slow)
shift default light-position a little bit, to make faces different color
2017-05-29 21:55:58 -07:00
Erwin Coumans
84d09cc18f Split CommonGfxVertex3D into two different ones, GfxVertexFormat0 and GfxVertexFormat1
Rewrite  GLInstancingRenderer::drawTexturedTriangleMesh
2017-05-24 13:05:16 -07:00
Erwin Coumans
df1b5b6ca5 fix shader issue 2017-05-23 23:17:57 -07:00
Erwin Coumans
db008ab3c2 Improve debug text/line rendering, can be use to draw frames and text in local coordinate of an object / link.
example:
kuka = p.loadURDF("kuka_iiwa/model.urdf")
p.getNumJoints(kuka)
pybullet.addUserDebugLine([0,0,0],[0,0,0.1],[0,0,1],trackObjectUniqueId=2,trackLinkIndex=6)
pybullet.addUserDebugText("tip", [0,0,0.1],textColorRGB=[1,0,0],trackObjectUniqueId=2,trackLinkIndex=6)
Also allow to render text using a given orientation (instead of pointing to the camera), example:
pybullet.addUserDebugText("tip", [0,0,0.1],textColorRGB=[1,0,0],textOrientation=[0,0,0,1], trackObjectUniqueId=2,trackLinkIndex=6)
Add drawTexturedTriangleMesh, for drawing 3d text.
Expose readSingleInstanceTransformToCPU, to extract position/orientation from graphics index.
updateTexture: allow to not flip texels around up axis
2017-05-23 22:05:26 -07:00