Commit Graph

14 Commits

Author SHA1 Message Date
Hans Goudey
7f5dd29abd Subdiv: Make OpenSubdiv_TopologyRefiner into a C++ class
Replace the C-class pattern function pointers with actual class methods.
Other than the obvious benefit of not requiring the "this" pointer to be
explicitly passed into every function call, this will make it much simpler
to remove the entire C-API class and replace it with its "impl" next.

For that next step we need to expose code to the implementation
of the topology refiner, so instead of defining stubs locally in the
opensubdiv intern class, we spread some WITH_OPENSUBDIV checks
in the blenkernel. As far as I know this is the only way to remove the
intermediate C-API and call opensubdiv functions directly from there.
2024-04-19 09:03:48 -04:00
Hans Goudey
8157f33911 Cleanup: Move opensubdiv C-API headers to C++
All the relevant code is C++ now, so we don't need to complicate things
with the trip through C anymore. We will still need some wrappers, since
opensubdiv is an optional dependency though. The goal is to make it
simpler to remove the unnecessary/costly abstraction levels between
Blender mesh data and the opensubdiv code.
2023-12-11 07:50:29 -05:00
Campbell Barton
1b508de749 License headers: use SPDX-FileCopyrightText in intern/opensubdiv 2023-06-15 16:47:51 +10:00
Sergey Sharybin
a12a8a71bb Remove "All Rights Reserved" from Blender Foundation copyright code
The goal is to solve confusion of the "All rights reserved" for licensing
code under an open-source license.

The phrase "All rights reserved" comes from a historical convention that
required this phrase for the copyright protection to apply. This convention
is no longer relevant.

However, even though the phrase has no meaning in establishing the copyright
it has not lost meaning in terms of licensing.

This change makes it so code under the Blender Foundation copyright does
not use "all rights reserved". This is also how the GPL license itself
states how to apply it to the source code:

    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) <year>  <name of author>

    This program is free software ...

This change does not change copyright notice in cases when the copyright
is dual (BF and an author), or just an author of the code. It also does
mot change copyright which is inherited from NaN Holding BV as it needs
some further investigation about what is the proper way to handle it.
2023-03-30 10:51:59 +02:00
Sergey Sharybin
d32d787f5f Clang-Format: Allow empty functions to be single-line
For example

```
OIIOOutputDriver::~OIIOOutputDriver()
{
}
```

becomes

```
OIIOOutputDriver::~OIIOOutputDriver() {}
```

Saves quite some vertical space, which is especially handy for
constructors.

Pull Request: https://projects.blender.org/blender/blender/pulls/105594
2023-03-29 16:50:54 +02:00
Campbell Barton
7ebd1f4b79 Cleanup: quiet compiler warnings 2022-07-19 13:32:53 +10:00
Dalai Felinto
a9a4bcc3d1 Fix building: stub for OpenSubdiv
Building problem introduced on 24e74f8bef813820. It affects `make lite`
and other builds that skip OpenSubdiv.
2022-05-30 16:10:22 +02:00
Brecht Van Lommel
342e12d6d9 Subdiv: support interpolating orco coordinates in subdivision surfaces
This makes changes to the opensubdiv module to support additional vertex data
besides the vertex position, that is smootly interpolated the same way. This is
different than varying data which is interpolated linearly.

Fixes T96596: wrong generated texture coordinates with GPU subdivision. In that
bug lazy subdivision would not interpolate orcos.

Later on, this implementation can also be used to remove the modifier stack
mechanism where modifiers are evaluated a second time for orcos, which is messy
and inefficient. But that's a more risky change, this is just the part to fix
the bug in 3.2.

Differential Revision: https://developer.blender.org/D14973
2022-05-18 16:45:38 +02:00
Kévin Dietrich
e28222966b Fix compile error when building without OpenSubDiv
Stubs were missing for functions added to opensubdiv_evaluator_capi.h
2021-12-28 09:36:30 +01:00
Aaron Carlisle
c1279768a7 Cleanup: Clang-Tidy modernize-redundant-void-arg 2021-12-08 00:31:20 -05:00
Sergey Sharybin
2ad5131f77 OpenSubdiv: Cleanyp, remove old GPU code
All parts of drawing (shaders, GL mesh descriptor, material partitioner
and so on) needs to be redone for the draw manager and new OpenSubdiv
library.

Removing untested code which is doomed to be replaced to make localized
refactoring easier.
2020-05-18 17:06:48 +02:00
Campbell Barton
e12c08e8d1 ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211.

For details on usage and instructions for migrating branches
without conflicts, see:

https://wiki.blender.org/wiki/Tools/ClangFormat
2019-04-17 06:21:24 +02:00
Sergey Sharybin
3a15834d63 OpenSubdiv: Cleanup 2018-09-26 10:21:34 +02:00
Sergey Sharybin
f8a499b596 OpenSubdiv: Add stub implementation of C-API
C-API is way smaller than the rest of the code which uses it.
So better to conditionally compile stub implementation than
to keep adding ifdef everywhere.
2018-08-13 12:37:18 +02:00