Commit Graph

85 Commits

Author SHA1 Message Date
Takahito Tejima
c3aa00e706 remove SupportsAdaptiveTessellation from OsdDrawContext, and example cleanups
As a preparation for retiring DrawContext, move SupportsAdaptiveTessellation
method to examples/common/glUtils, which is renamed and namespaced
from gl_common.{cpp,h} to be consistent to other files.
Same renamings applied to other example files.
2015-05-19 10:30:16 -07:00
Takahito Tejima
4a4322983f Osd drawing API refactoring.
Remove DrawRegistry from osd layer and put a simple shader caching
utility into examples/common. osd layer only provides patch shader
snippet and let client configure and compile the code. Clients also
maintain the lifetime of shader object, which is preferable for the
actual application integration.

update all examples to use the new scheme.
2015-05-13 17:35:46 -07:00
Takahito Tejima
b66380ee52 Refactor Osd::DrawContext
Since unified shading work already removed subPatch info from
Osd::PatchDescriptor, the difference between Far::PatchDescriptor and
Osd::PatchDescriptor is just maxValence and numElements. They are used
for legacy gregory patch drawing.

Both maxValence and numElements are actually constant within a topology
(drawContext). This change move maxValence to DrawContext and let client
manage numElements, then we can eliminate Osd::PatchDescriptor and simply
use Far::PatchDescritor instead.

This is still an intermediate step toward further DrawRegistry refactoring.
For the time being, adding EffectDesc struct to include maxValence and
numValence to be maintained by the clients. They will be cleaned up later.

The side benefit of this change is we no longer need to recompile regular b-spline
shaders for the different max-valences.
2015-05-11 18:06:46 -07:00
Takahito Tejima
8fc0e5db93 Move Ptex code from osd to examples.
we're teasing out ptex specific data from core osd entities,
so there's no reason to keep ptex texturing utilities in core osd.
move them into example libs and let clients assemble shader snippets
as needed.

Also removing older ptex texturing code (without mipmap)
2015-05-07 13:56:48 -07:00
George ElKoura
46569132cf Fixed build breakage for CLEW. 2015-04-30 18:28:48 -07:00
Takahito Tejima
b3da5d3fab remove libpng and use stb_image_write instead 2015-04-30 11:04:16 -07:00
Takahito Tejima
9316852e69 use OPENSUBDIV_HAS_DX11SDK
replace OPENSUBDIV_HAS_DX of the previous change with
OPENSUBDIV_HAS_DX11SDK since we already have that.
2015-04-29 17:06:42 -07:00
takahito-tejima
04009e8a80 fix mac build. 2015-04-29 14:14:41 -07:00
Takahito Tejima
dcb022e1db Fix DX-OpenCL/CUDA interop.
- resolves DX-CL interop functions in Osd::ClD3D11VertexBuffer.
- enable CL kernels in DX build.
- more cleanup in test harnesses, adding D3D11 initializations into DeviceContext.
- add new defines OPENSUBDIV_HAS_OPENGL and OPENSUBDIV_HAS_DX for convenience.
2015-04-29 11:51:12 -07:00
Takahito Tejima
82a0513326 cleanup CL/CUDA example harnesses.
refactor CL/CUDA specific initialization stuffs into
examples/common/clDeviceContext and cudaDeviceContext, and
update examples to use those structs.

also
- remove CL/CUDA tests from osd_regression. The tests for those kernels will be covered by glImaging.
- update cuda initialization to use the GL-interoperable device if available.
- remove CL specialization from glShareTopology, following the same pattern as we took in the previous OsdGLMesh refactoring. (still something strange with XFB kernels though)
- fix file permissions.
2015-04-28 15:46:37 -07:00
Takahito Tejima
aec1f61fb0 Merge pull request #422 from davidgyu/patch-drawing
Unified adaptive patch drawing
2015-04-17 15:39:37 -07:00
David G Yu
010a31efc4 Checkpoint changes to unify adaptive patch drawing. 2015-04-17 07:42:53 -07:00
asluk
4752bcdd69 Add support for lefthanded meshes. 2015-04-15 16:13:43 -07:00
Takahito Tejima
24f9dc154b Enable GregoryBasis patch.
PatchTablesFactory fills 20 indices topology into patchtable, and use it for eval and draw.

note: currently screen-space adaptive tessellation of gregory basis patches is
broken and cracks appear around them.
2015-04-08 17:07:10 -07:00
jcowles
13e9b43b38 Removing attempt to silence compiler warning.
This wasn't compiling on Windows and worse. Instead, we plan to disable the
warning as a compiler switch.
2015-04-02 11:11:12 -07:00
jcowles
76efdcfcf7 Fix initCL, make conditional based on CLEW
When CLEW is present, CL functions become macros which may resolve to null
function pointers. A previous change attempted to guard against CL-related
crashes, but introduced compiler warnings.

This change conditionally tests the function when CLEW is present.

Resolves: #400
2015-03-31 15:05:13 -07:00
Jeremy Cowles
28e39bf86f Enable osd_regression and suppress warnings. 2015-03-30 22:18:18 -07:00
George ElKoura
da9c8a83dc Make sure to double check that we have properly bound the OpenCL API
before using it.
2015-03-29 17:06:24 -07:00
George Elkoura
9d22e8bdda Make sure to include <string> before we use it in clInit.h 2015-03-28 23:44:10 -07:00
manuelk
9e25b193ff Fix Win build 2015-02-27 15:52:12 -08:00
manuelk
d0a624f373 Add "smooth UVs" to Far
- extend Far::PatchTables data structures & interfaces to store requisite
  information for channels of face-varying bi-cubic patches
- implement gather function in Far::PatchTablesFactory to populate face-varying
  channels with adaptive patches
- extend accessor interface in Vtr::Level
- propagate code fall-out throughout OpenSubdiv code base, examples & tutorials
- extend vtrViewer code to visualize tessellated bi-cubic face-varying patches
2015-02-26 13:57:47 -08:00
manuelk
5e0c13f188 Add a fast code path to bypass frame interpolation when reading single (non-animated) OBJ files 2015-01-22 11:06:33 -08:00
manuelk
04c63537d1 Change patch color coding for single-crease transition patches
- add a small gradient to the patchColors tables so that single-crease transition patterns
  have slightly different colors
2015-01-22 11:05:01 -08:00
manuelk
b27b55e4a8 Refactor Far::PatchTables
- split Far::PatchDescriptor into its own class (mirrors Far::PatchParam)
- hide PatchArray as a private internal structure
- add public accessors patterned after Far::TopologyRefiner (returning Vtr::Arrays)
- propagate new API to all dependent code

note: some direct table accessors have not been removed *yet* - see code for details
2014-11-25 12:41:19 -08:00
manuelk
b599bbc0cc Fix vtrViewer code example
- add control to toggle display of gregory basis
- add dedicated (yellow) color to common/patchColors for gregory basis
- fix display of end-cap quads
2014-11-18 10:57:19 -08:00
David G Yu
e99ac7e0c1 Updated example framework code to disable SSAO by default. 2014-10-24 11:18:51 -07:00
David G Yu
4c0f026bee Fixed a few problems with High DPI displays in the example programs. 2014-10-24 11:15:19 -07:00
manuelk
7d07e341e0 Adjust near clipping plane in glViewer automatically when SSAO is turned off
- when SSAO is turned off, we can bring the near clipping plane much closer to help close-up inspection...
2014-10-21 18:50:54 -07:00
Takahito Tejima
c0907c7bc1 Introduces 'single-crease patch' : implements "Efficient Evaluation of Semi-Smooth Creases in
Catmull-Clark Subdivision Surfaces", Niessner et al, Eurographics 2012.

This change includes;
-topology identification for single-crease patch during adaptive refinement.
-patch array population (similar to boundary)
-sharpness buffer generation
-glsl shader

Eval stuffs will be coming.
2014-10-13 08:52:09 -07:00
manuelk
c93a15b9df Extend export_obj.py Maya script to export uv set named 'map1' 2014-09-10 11:11:42 -07:00
manuelk
c399655dcc Landing 3.0.0.alpha
Sync'ing the 'dev' branch with the 'feature_3.0dev' branch at commit 68c6d11fc36761ae1a5e6cdc3457be16f2e9704a

The branch 'feature_3.0dev' is now locked and preserved for historical purposes.
2014-09-05 15:07:46 -07:00
Nicholas Yue
4d36cf8c3c Fix duplicate variables with identical name 2014-06-25 14:52:33 -07:00
manuelk
50874a5d00 Fix OSX Core Profile build
- remove obsolete glPushClient functions

note: this code is still duplicated in the ptexViewer (which still needs to be upgraded to the new framebuffer)

fixes #307
2014-05-28 12:39:43 -07:00
manuelk
84fcf01a40 Fixing broken build (forgot to remove WIP hbao from CMakeList) 2014-05-28 10:37:56 -07:00
Manuel Kraemer
8741687d20 Code cleanup for GLFrameBuffer in examples/common
- cleanup some duplicated code
- change the background color ramp function to make UI more readable
2014-05-27 07:20:57 -07:00
Takahito Tejima
46baf7af2f Fix Hud (d3d11) 2014-05-23 13:30:36 -07:00
Takahito Tejima
9a6c37b86d Fix Hud display for higher DPI (MBP retina) 2014-05-23 13:24:31 -07:00
Sergey Sharybin
6ef232c95a Integrate CLEW into osd library and examples
If the system has CLEW installed (which is detected by recently
added FindCLEW routines) then OpenSubduv would be compiled against
this library.

It makes binaries and libraries more portable across the systems,
so it's possible to run the same binary on systems with and without
OpenCL SDK installed.

The most annoying part of the change is updating examples to load
OpenCL libraries, but ideally code around controllers and interface
creation is to be de-duplicated anyway.

Based on the pull request #303 from Martijn Berger
2014-05-22 09:10:59 +02:00
Sergey Sharybin
f6d45a6de0 Fix compilation error on windows+msvc2013
- Some missing includes of <algorithms> in order to have
  stdd::min() and similar functions.
- Need to cast numIndices and numNVerts to int explicitly
  in order to solve warning treated as an error about
  precision loss.
- Can't do vector[0] for an empty vector, it'll generate
  a runtime range check error.
- MSVC only works fine with make_pair(foo, bar) syntax,
  without explicit template substitution here. Otherwise
  weird 'can't cast int to int&&' errors are happening.
2014-05-17 12:52:02 -07:00
manuelk
da5db17d15 Fix framebuffer shader compiling for OSX
The driver apparently does not tolerate #version after a #define
2014-05-16 14:36:29 -07:00
manuelk
77b71a0446 Minor fixes to gl_hud and gl_framebuffer
- leave framebuffer off by default (and remove SSAO UI from examples)
- fix some resources leakage when toggling SSAO on/off
2014-05-16 13:38:25 -07:00
manuelk
9913e349df Adding a programmable image shader to gl_hud
- add a framebuffer to gl_hud with programmable image shader
- add optional SSAO image shader to the new framebuffer
- add screenshot to png functionality
- implement in glViewer

note: ptexViewer and some others still need refactoring to use the new hud capabilities
2014-05-15 13:53:43 -07:00
manuelk
1284fa958b Minor cosmetic fixes to the HUD's font 2014-04-30 16:41:55 -07:00
manuelk
d6889c2105 Fix HUD pulldown mouse-click to handle relative window coordinates. 2014-04-30 16:08:49 -07:00
manuelk
7100f41f6c Minor improvements to HUD pulldown
- don't close the pull-down when selecting an item
- change color of down-arrow to yellow when the pulldown is open
2014-04-30 15:41:05 -07:00
manuelk
a7d5db4d7d More cosmetic fixes to examples' GUI
- fix default selection for pulldown widgets
- move widgets around to prevent overlap in examples
- add a little triangle indicator to the pulldown widget
- switch color from white to yellow for selected pulldown item
2014-04-28 16:36:39 -07:00
Manuel Kraemer
00f2419388 Additional GUI updates to GL example code
- switch Compute selection to pull-down menu
- add TBB controller to ptexViewer
- small cleanup in Hud

note: shading should also switch to a pull-down
2014-04-27 23:05:18 -07:00
Manuel Kraemer
aa584ed2ce Adding a PullDown widget to our HUD in examples/common
- adding pulldown type menu selector
- updated shape selection to use the new widget in various Gl examples
2014-04-27 18:38:51 -07:00
David G. Yu
d426d6f07c One more fix for the windows cmake build
fixes #258
2014-04-09 15:16:13 -07:00
mkraemer
0f687c4c62 Fix Windows build following CMake changes
Add conditionals testing for non-empty OPENGL_INCLUDE_DIR path

fixes #258
2014-04-09 18:09:53 -04:00