Initial Grease Pencil 3.0 stage #106848
|
@ -218,6 +218,7 @@ else()
|
|||
harvest(openimagedenoise/lib openimagedenoise/lib "*.a")
|
||||
harvest(embree/include embree/include "*.h")
|
||||
harvest(embree/lib embree/lib "*.a")
|
||||
harvest(embree/lib embree/lib "*${SHAREDLIBEXT}*")
|
||||
harvest(openpgl/include openpgl/include "*.h")
|
||||
harvest(openpgl/lib openpgl/lib "*.a")
|
||||
harvest(openpgl/lib/cmake/openpgl-${OPENPGL_SHORT_VERSION} openpgl/lib/cmake/openpgl "*.cmake")
|
||||
|
|
|
@ -1628,7 +1628,7 @@ DISTRO_IDS_INSTALLERS = {
|
|||
def get_distro(settings):
|
||||
if settings.distro_id is not ...:
|
||||
settings.logger.info(f"Distribution identifier forced by user to {settings.distro_id}.")
|
||||
return
|
||||
return settings.distro_id
|
||||
import platform
|
||||
info = platform.freedesktop_os_release()
|
||||
ids = [info["ID"]]
|
||||
|
|
|
@ -1088,7 +1088,7 @@ if(WITH_CYCLES AND (WITH_CYCLES_DEVICE_ONEAPI OR (WITH_CYCLES_EMBREE AND EMBREE_
|
|||
${SYCL_ROOT_DIR}/bin/sycl[0-9].dll
|
||||
)
|
||||
foreach(sycl_runtime_library IN LISTS _sycl_runtime_libraries_glob)
|
||||
string(REPLACE ".dll" "_d.dll" sycl_runtime_library_debug ${sycl_runtime_library})
|
||||
string(REPLACE ".dll" "d.dll" sycl_runtime_library_debug ${sycl_runtime_library})
|
||||
list(APPEND _sycl_runtime_libraries RELEASE ${sycl_runtime_library})
|
||||
list(APPEND _sycl_runtime_libraries DEBUG ${sycl_runtime_library_debug})
|
||||
endforeach()
|
||||
|
|
|
@ -1853,8 +1853,6 @@ def pyrna2sphinx(basepath):
|
|||
fw(" %s\n\n" % operator_description)
|
||||
for prop in op.args:
|
||||
write_param(" ", fw, prop)
|
||||
if op.args:
|
||||
fw("\n")
|
||||
|
||||
location = op.get_location()
|
||||
if location != (None, None):
|
||||
|
@ -1865,9 +1863,12 @@ def pyrna2sphinx(basepath):
|
|||
else:
|
||||
url_base = API_BASEURL
|
||||
|
||||
fw(" :file:`%s\\:%d <%s/%s#L%d>`_\n\n" %
|
||||
fw(" :File: `%s\\:%d <%s/%s#L%d>`__\n\n" %
|
||||
(location[0], location[1], url_base, location[0], location[1]))
|
||||
|
||||
if op.args:
|
||||
fw("\n")
|
||||
|
||||
file.close()
|
||||
|
||||
if "bpy.ops" not in EXCLUDE_MODULES:
|
||||
|
|
|
@ -14,3 +14,13 @@ The first three of them were employed by the Blender Foundation during that time
|
|||
Some features (random sounds, dynamic music, playback manager, convolution and HRTFs support) were added as part of the VALS (Virtual Alliances for Learning Society) project by
|
||||
|
||||
- Juan Francisco Crespo Galán <dethon_5@outlook.com>
|
||||
|
||||
The Equalizer sound effect has been added by
|
||||
|
||||
- Marcos Perez
|
||||
|
||||
Several people provided fixes:
|
||||
|
||||
- Aaron Carlisle
|
||||
- Sebastian Parborg
|
||||
- Leon Zandman
|
||||
|
|
|
@ -1,3 +1,104 @@
|
|||
Audaspace 1.4
|
||||
|
||||
- Support for OS specific/native audio devices/backends has been added, that is PulseAudio (Linux), WASAPI (Windows) and CoreAudio (MacOS).
|
||||
- New sound effects have been added, namely Modulator and Equalizer. Thanks to Marcos Perez for contributing the Equalizer.
|
||||
- File stream info: if an audio file contains multiple streams you can choose which one to process instead of taking the first one (this feature is only supported by ffmpeg, not libsndfile).
|
||||
- API Change: double instead of float for time values for more precise timing control.
|
||||
- There have been lots of bugfixes, which are basically the majority of all changes.
|
||||
- And some other minor improvements were implemented as well.
|
||||
|
||||
Detailed list of changes:
|
||||
|
||||
d4042d9 Port changes in Blender to upstream.
|
||||
b60fb45 Equalizer
|
||||
ab04e84 Fixes
|
||||
8f0c305 Fix build error with MSVC 17.4+ ported from Blender.
|
||||
ce44342 Minor documentation update.
|
||||
cdcb3f4 Migrate from distuils to setuptools for python module.
|
||||
21eccef Fix FindFFTW to find the float version fftw3f.
|
||||
ab15e2f Bugfix: API change in new ffmpeg version.
|
||||
a097be8 Clang format file added, valid from now on.
|
||||
2fc9fb7 Porting bugfix from Blender upstream.
|
||||
bb655b7 Bugfix: wrong sample size computation for PulseAudio.
|
||||
a150495 Bugfix: Buffer did not support buffers > 2 GB.
|
||||
034645c Update for ffmpeg 5.
|
||||
932739c Bugfix: WASAPI hangs.
|
||||
4fcd47c WASAPI: fix bug when switching the default device while there is no playback.
|
||||
a16fbd2 Python API: fix to get convolution in the python API.
|
||||
27ac5c1 WASAPI: always switch to default audio device.
|
||||
1b03e6c Bugfix: catch exception if file cannot be read.
|
||||
369ff6e PulseAudio: remove unused underflow callback.
|
||||
2d8bf3a PulseAudio: improve synchronization accuracy.
|
||||
4868e14 Revert PulseAudioDevice back from ThreadedDevice to threaded mainloop.
|
||||
6a04446 Adding a jack style mixing thread with a ring buffer for pulseaudio.
|
||||
5d4b57b Implement RingBuffer class.
|
||||
e02d3aa FFMPEG: fix seeking and duration calculation.
|
||||
07b9fa0 Adding file stream functionality.
|
||||
5a8ad27 Porting changes from Blender.
|
||||
fa47258 Bugfix: PulseAudio writing to little data on request.
|
||||
ca3edb5 PulseAudio: increase buffersize.
|
||||
6d36f3e Pulseaudio: may fix crackling playback start bug.
|
||||
dbeac4b WASAPI: reinitialize device when lost.
|
||||
0cba4d3 Bugfix Pulseaudio: might hang.
|
||||
b73dc6d Bugfix: ffmpeg 4.4 requires channels to be set.
|
||||
f1ecbe0 Fixed typo.
|
||||
09e4f27 Rewrite PulseAudioDevice to use ThreadedDevice.
|
||||
9516924 WASAPI: refactor to simplify and use ThreadedDevice.
|
||||
749c974 Add ThreadedDevice.
|
||||
e68b355 Fix some locks in SoftwareDevice.
|
||||
44b57af Bugfix for deadlock in WASAPIDevice.
|
||||
8c4b266 CMake: fix ERROR to FATAL_ERROR in MESSAGE.
|
||||
5a17338 Rename NullDevice's reported name to None.
|
||||
cd138d7 PulseAudio: add dynamic loading and threading fixes.
|
||||
6e0250f CoreAudio: add CoreAudioClock as synchronizer.
|
||||
43aff35 Fix leakage in CoreAudioDevice.cpp
|
||||
7f6f059 Remove unnecessary cmake code.
|
||||
a5c1a02 Add CoreAudio device for Apple.
|
||||
af96f67 Indentation fix.
|
||||
eec8fd5 WASAPI: use padding also for first buffer submission.
|
||||
c63bd9b WASAPI: deal with IsFormatSupported case.
|
||||
079cccb Hide WITH_PULSEAUDIO when not on Linux.
|
||||
67b5013 Add mingw64 cross compilation toolchain on Linux.
|
||||
a7bfa58 Add WASAPI backend for Windows.
|
||||
be1cb25 Allow AUD_init with nullptr to use default device.
|
||||
fc68868 Compilation fix for mingw.
|
||||
bb79d25 Add a PulseAudio output device.
|
||||
a11f593 Bugfix for unwanted volume fading at the beginning of sounds.
|
||||
8510acf Bugfix: more accurate positioning of sequences.
|
||||
cb816c1 Fix API docs for python playback manager play function
|
||||
d125fa2 Add callback for mixing down audio.
|
||||
789832e Fix numpy import.
|
||||
9a6a802 Bugfix: JOS resampling type bugfix caused integer underflow.
|
||||
ece0842 Fix corrupted document in python bindings
|
||||
28b2ea2 SDL 2: support more audio formats.
|
||||
a39b7e3 Trying to fix Travis CI build for OS X.
|
||||
c924007 Some more changes of times from flaot to double.
|
||||
659afd4 Porting fixes from blender.
|
||||
8e5e2e6 Fix documentation warnings.
|
||||
7a6054f API: All times are now double instead of float.
|
||||
452a724 Mixer sample buffer added channels twice
|
||||
8ddb6c1 Docs: Cleanup Line Wrapping for python examples
|
||||
a0c37b2 Docs: Use class methods for api docs
|
||||
2f8b2e3 Bugfix for invalid offsets provided by ffmpeg's seeking code.
|
||||
20a7a28 Bug fixes for files with more than 8 channels.
|
||||
94dc527 Bugfix: Fading from full volume.
|
||||
2fb9862 Fix: Missing include in FileManager.h.
|
||||
afadb94 Minor CMakeLists.txt formatting fixes.
|
||||
734ef03 Add sample rate parameter to silence generation.
|
||||
ed50f3b Bugfix: Return correct length for modulator and superpose.
|
||||
cb7a314 Adding a modulator sound effect.
|
||||
101c714 Bugfix: don't add non-existing devices to the device manager.
|
||||
7ad99df OpenAL: recreate device if disconnected.
|
||||
a2ff4e8 Bugfix: memory leak in python API.
|
||||
5fb21bb Silence some warnings.
|
||||
9b38605 Some fixes backported from Blender.
|
||||
40a0a34 Udpate for travis.ci.
|
||||
212b4b6 Support newer ffmpeg versions.
|
||||
d27746c Build option: configure whether to build versioned plugins.
|
||||
19c8d9f Make fftw3 optional.
|
||||
aa11968 Bugfix for building with gcc7.
|
||||
10413c5 Fix for seeking with modified pitch.
|
||||
|
||||
Audaspace 1.3
|
||||
=============
|
||||
|
||||
|
@ -10,6 +111,8 @@ Audaspace 1.3
|
|||
- filter python API parameter check
|
||||
- finding ffmpeg with pkgconfig
|
||||
|
||||
Detailed list of changes:
|
||||
|
||||
64884a7 Windows fixes.
|
||||
53ba3e6 Implemented JACK dynamic loading.
|
||||
5ee0ee1 Continues last commit.
|
||||
|
@ -46,6 +149,8 @@ Audaspace 1.2
|
|||
- assuring numpy is installed
|
||||
- building the Python module on Mac OS X with CMake
|
||||
|
||||
Detailed list of changes:
|
||||
|
||||
a6b6e70 Changing default sample rate from 44.1 to 48 kHz.
|
||||
20f0164 Bugfix: CMake custom command for python module on OS X.
|
||||
98679a2 Bugfix: using standard library (s)rand.
|
||||
|
|
|
@ -23,7 +23,7 @@ endif()
|
|||
|
||||
project(audaspace)
|
||||
|
||||
set(AUDASPACE_VERSION 1.3)
|
||||
set(AUDASPACE_VERSION 1.4)
|
||||
set(AUDASPACE_LONG_VERSION ${AUDASPACE_VERSION}.0)
|
||||
|
||||
if(DEFINED AUDASPACE_CMAKE_CFG)
|
||||
|
|
|
@ -15,7 +15,7 @@ Audaspace is written in C++ 11 so a fairly recent compiler (g++ 4.8.2, clang 3.3
|
|||
- Jack (output device)
|
||||
- libsndfile (file access)
|
||||
- ffmpeg (file access)
|
||||
- Python (language binding)
|
||||
- Python (language binding, needs NumPy as well)
|
||||
|
||||
Getting the Code
|
||||
----------------
|
||||
|
|
|
@ -32,7 +32,7 @@ The following (probably incomplete) features are supported by audaspace:
|
|||
License
|
||||
-------
|
||||
|
||||
> Copyright © 2009-2015 Jörg Müller. All rights reserved.
|
||||
> Copyright © 2009-2023 Jörg Müller. All rights reserved.
|
||||
>
|
||||
> Licensed under the Apache License, Version 2.0 (the "License");
|
||||
> you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -165,6 +165,12 @@ AUD_API void AUD_SequenceEntry_move(AUD_SequenceEntry* entry, double begin, doub
|
|||
(*entry)->move(begin, end, skip);
|
||||
}
|
||||
|
||||
AUD_API void AUD_SequenceEntry_setConstantRangeAnimationData(AUD_SequenceEntry* entry, AUD_AnimateablePropertyType type, int frame_start, int frame_end, float* data)
|
||||
{
|
||||
AnimateableProperty* prop = (*entry)->getAnimProperty(static_cast<AnimateablePropertyType>(type));
|
||||
prop->writeConstantRange(data, frame_start, frame_end);
|
||||
}
|
||||
|
||||
AUD_API void AUD_SequenceEntry_setAnimationData(AUD_SequenceEntry* entry, AUD_AnimateablePropertyType type, int frame, float* data, char animated)
|
||||
{
|
||||
AnimateableProperty* prop = (*entry)->getAnimProperty(static_cast<AnimateablePropertyType>(type));
|
||||
|
|
|
@ -68,6 +68,16 @@ extern AUD_API void AUD_Sequence_remove(AUD_Sound* sequence, AUD_SequenceEntry*
|
|||
* Writes animation data to a sequence.
|
||||
* \param sequence The sound scene.
|
||||
* \param type The type of animation data.
|
||||
* \param frame_start Start of the frame range.
|
||||
* \param frame_end End of the frame range.
|
||||
* \param data The data to write.
|
||||
*/
|
||||
AUD_API void AUD_SequenceEntry_setConstantRangeAnimationData(AUD_SequenceEntry* entry, AUD_AnimateablePropertyType type, int frame_start, int frame_end, float* data);
|
||||
|
||||
/**
|
||||
* Writes animation data to a sequenced entry.
|
||||
* \param entry The sequenced entry.
|
||||
* \param type The type of animation data.
|
||||
* \param frame The frame this data is for.
|
||||
* \param data The data to write.
|
||||
* \param animated Whether the attribute is animated.
|
||||
|
|
|
@ -112,6 +112,14 @@ public:
|
|||
*/
|
||||
void write(const float* data, int position, int count);
|
||||
|
||||
/**
|
||||
* Fills the properties frame range with constant value and marks it animated.
|
||||
* \param data The new value.
|
||||
* \param position_start The start position in the animation in frames.
|
||||
* \param position_end The end position in the animation in frames.
|
||||
*/
|
||||
void writeConstantRange(const float* data, int position_start, int position_end);
|
||||
|
||||
/**
|
||||
* Reads the properties value.
|
||||
* \param position The position in the animation in frames.
|
||||
|
|
|
@ -198,12 +198,13 @@ public:
|
|||
/**
|
||||
* Adds a new entry to the scene.
|
||||
* \param sound The sound this entry should play.
|
||||
* \param sequence_data Reference to sequence_data. Mainly needed to get the FPS of the scene.
|
||||
* \param begin The start time.
|
||||
* \param end The end time or a negative value if determined by the sound.
|
||||
* \param skip How much seconds should be skipped at the beginning.
|
||||
* \return The entry added.
|
||||
*/
|
||||
std::shared_ptr<SequenceEntry> add(std::shared_ptr<ISound> sound, double begin, double end, double skip);
|
||||
std::shared_ptr<SequenceEntry> add(std::shared_ptr<ISound> sound, std::shared_ptr<SequenceData> sequence_data, double begin, double end, double skip);
|
||||
|
||||
/**
|
||||
* Removes an entry from the scene.
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
*/
|
||||
|
||||
#include "sequence/AnimateableProperty.h"
|
||||
#include "sequence/SequenceData.h"
|
||||
#include "util/ILockable.h"
|
||||
|
||||
#include <mutex>
|
||||
|
@ -63,6 +64,9 @@ private:
|
|||
/// How many seconds are skipped at the beginning.
|
||||
double m_skip;
|
||||
|
||||
/// reference to sequence_data. Mainly needed to get the FPS of the scene.
|
||||
std::shared_ptr<SequenceData> m_sequence_data;
|
||||
|
||||
/// Whether the entry is muted.
|
||||
bool m_muted;
|
||||
|
||||
|
@ -122,9 +126,10 @@ public:
|
|||
* \param begin The start time.
|
||||
* \param end The end time or a negative value if determined by the sound.
|
||||
* \param skip How much seconds should be skipped at the beginning.
|
||||
* \param sequence_data Reference to sequence_data. Mainly needed to get the FPS of the scene.
|
||||
* \param id The ID of the entry.
|
||||
*/
|
||||
SequenceEntry(std::shared_ptr<ISound> sound, double begin, double end, double skip, int id);
|
||||
SequenceEntry(std::shared_ptr<ISound> sound, double begin, double end, double skip, std::shared_ptr<SequenceData> sequence_data, int id);
|
||||
virtual ~SequenceEntry();
|
||||
|
||||
/**
|
||||
|
|
|
@ -65,6 +65,19 @@ void AnimateableProperty::write(const float* data)
|
|||
std::memcpy(getBuffer(), data, m_count * sizeof(float));
|
||||
}
|
||||
|
||||
void AnimateableProperty::writeConstantRange(const float* data, int position_start, int position_end)
|
||||
{
|
||||
assureSize(position_end * m_count * sizeof(float), true);
|
||||
float* buffer = getBuffer();
|
||||
|
||||
for(int i = position_start; i < position_end; i++)
|
||||
{
|
||||
std::memcpy(buffer + i * m_count, data, m_count * sizeof(float));
|
||||
}
|
||||
|
||||
m_isAnimated = true;
|
||||
}
|
||||
|
||||
void AnimateableProperty::write(const float* data, int position, int count)
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> lock(m_mutex);
|
||||
|
|
|
@ -92,7 +92,7 @@ AnimateableProperty* Sequence::getAnimProperty(AnimateablePropertyType type)
|
|||
|
||||
std::shared_ptr<SequenceEntry> Sequence::add(std::shared_ptr<ISound> sound, double begin, double end, double skip)
|
||||
{
|
||||
return m_sequence->add(sound, begin, end, skip);
|
||||
return m_sequence->add(sound, m_sequence, begin, end, skip);
|
||||
}
|
||||
|
||||
void Sequence::remove(std::shared_ptr<SequenceEntry> entry)
|
||||
|
|
|
@ -149,11 +149,11 @@ AnimateableProperty* SequenceData::getAnimProperty(AnimateablePropertyType type)
|
|||
}
|
||||
}
|
||||
|
||||
std::shared_ptr<SequenceEntry> SequenceData::add(std::shared_ptr<ISound> sound, double begin, double end, double skip)
|
||||
std::shared_ptr<SequenceEntry> SequenceData::add(std::shared_ptr<ISound> sound, std::shared_ptr<SequenceData> sequence_data, double begin, double end, double skip)
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> lock(m_mutex);
|
||||
|
||||
std::shared_ptr<SequenceEntry> entry = std::shared_ptr<SequenceEntry>(new SequenceEntry(sound, begin, end, skip, m_id++));
|
||||
std::shared_ptr<SequenceEntry> entry = std::shared_ptr<SequenceEntry>(new SequenceEntry(sound, begin, end, skip, sequence_data, m_id++));
|
||||
|
||||
m_entries.push_back(entry);
|
||||
m_entry_status++;
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
AUD_NAMESPACE_BEGIN
|
||||
|
||||
SequenceEntry::SequenceEntry(std::shared_ptr<ISound> sound, double begin, double end, double skip, int id) :
|
||||
SequenceEntry::SequenceEntry(std::shared_ptr<ISound> sound, double begin, double end, double skip, std::shared_ptr<SequenceData> sequence_data, int id) :
|
||||
m_status(0),
|
||||
m_pos_status(1),
|
||||
m_sound_status(0),
|
||||
|
@ -31,6 +31,7 @@ SequenceEntry::SequenceEntry(std::shared_ptr<ISound> sound, double begin, double
|
|||
m_begin(begin),
|
||||
m_end(end),
|
||||
m_skip(skip),
|
||||
m_sequence_data(sequence_data),
|
||||
m_muted(false),
|
||||
m_relative(true),
|
||||
m_volume_max(1.0f),
|
||||
|
|
|
@ -241,10 +241,38 @@ bool SequenceHandle::seek(double position)
|
|||
return false;
|
||||
|
||||
std::lock_guard<ILockable> lock(*m_entry);
|
||||
double seekpos = position - m_entry->m_begin;
|
||||
if(seekpos < 0)
|
||||
seekpos = 0;
|
||||
seekpos += m_entry->m_skip;
|
||||
|
||||
double seek_frame = (position - m_entry->m_begin) * m_entry->m_sequence_data->getFPS();
|
||||
|
||||
if(seek_frame < 0)
|
||||
seek_frame = 0;
|
||||
|
||||
seek_frame += m_entry->m_skip * m_entry->m_sequence_data->getFPS();
|
||||
|
||||
AnimateableProperty* pitch_property = m_entry->getAnimProperty(AP_PITCH);
|
||||
|
||||
double target_frame = 0;
|
||||
|
||||
if(pitch_property != nullptr)
|
||||
{
|
||||
int frame_start = (m_entry->m_begin - m_entry->m_skip) * m_entry->m_sequence_data->getFPS();
|
||||
|
||||
for(int i = 0; seek_frame > 0; i++)
|
||||
{
|
||||
float pitch;
|
||||
pitch_property->read(frame_start + i, &pitch);
|
||||
const double factor = seek_frame > 1.0 ? 1.0 : seek_frame;
|
||||
target_frame += pitch * factor;
|
||||
seek_frame--;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
target_frame = seek_frame;
|
||||
}
|
||||
|
||||
double seekpos = target_frame / m_entry->m_sequence_data->getFPS();
|
||||
|
||||
m_handle->setPitch(1.0f);
|
||||
m_handle->seek(seekpos);
|
||||
|
||||
|
|
|
@ -51,6 +51,12 @@ if(WITH_CYCLES_STANDALONE AND WITH_CYCLES_STANDALONE_GUI)
|
|||
endif()
|
||||
|
||||
if(WITH_USD)
|
||||
# Silence warning from USD headers using deprecated TBB header.
|
||||
add_definitions(
|
||||
-D__TBB_show_deprecation_message_atomic_H
|
||||
-D__TBB_show_deprecation_message_task_H
|
||||
)
|
||||
|
||||
list(APPEND INC_SYS
|
||||
${USD_INCLUDE_DIRS}
|
||||
)
|
||||
|
|
|
@ -609,59 +609,60 @@ void BlenderSync::sync_particle_hair(
|
|||
}
|
||||
}
|
||||
|
||||
static std::optional<BL::FloatAttribute> find_curves_radius_attribute(BL::Curves b_curves)
|
||||
static const float *find_radius_attribute(BL::Curves b_curves)
|
||||
{
|
||||
for (BL::Attribute &b_attribute : b_curves.attributes) {
|
||||
if (b_attribute.name() != "radius") {
|
||||
continue;
|
||||
}
|
||||
if (b_attribute.domain() != BL::Attribute::domain_POINT) {
|
||||
continue;
|
||||
}
|
||||
if (b_attribute.data_type() != BL::Attribute::data_type_FLOAT) {
|
||||
continue;
|
||||
}
|
||||
return BL::FloatAttribute{b_attribute};
|
||||
BL::FloatAttribute b_float_attribute{b_attribute};
|
||||
if (b_float_attribute.data.length() == 0) {
|
||||
return nullptr;
|
||||
}
|
||||
return static_cast<const float *>(b_float_attribute.data[0].ptr.data);
|
||||
}
|
||||
return std::nullopt;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
static BL::FloatVectorAttribute find_curves_position_attribute(BL::Curves b_curves)
|
||||
static const float (*find_position_attribute(BL::Curves b_curves))[3]
|
||||
{
|
||||
for (BL::Attribute &b_attribute : b_curves.attributes) {
|
||||
if (b_attribute.name() != "position") {
|
||||
continue;
|
||||
}
|
||||
if (b_attribute.domain() != BL::Attribute::domain_POINT) {
|
||||
continue;
|
||||
}
|
||||
if (b_attribute.data_type() != BL::Attribute::data_type_FLOAT_VECTOR) {
|
||||
continue;
|
||||
}
|
||||
return BL::FloatVectorAttribute{b_attribute};
|
||||
BL::FloatVectorAttribute b_float3_attribute{b_attribute};
|
||||
if (b_float3_attribute.data.length() == 0) {
|
||||
return nullptr;
|
||||
}
|
||||
return static_cast<const float(*)[3]>(b_float3_attribute.data[0].ptr.data);
|
||||
}
|
||||
/* The position attribute must exist. */
|
||||
assert(false);
|
||||
return BL::FloatVectorAttribute{b_curves.attributes[0]};
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template<typename TypeInCycles, typename GetValueAtIndex>
|
||||
static void fill_generic_attribute(BL::Curves &b_curves,
|
||||
static void fill_generic_attribute(const int num_curves,
|
||||
const int num_points,
|
||||
TypeInCycles *data,
|
||||
const AttributeElement element,
|
||||
const GetValueAtIndex &get_value_at_index)
|
||||
{
|
||||
switch (element) {
|
||||
case ATTR_ELEMENT_CURVE_KEY: {
|
||||
const int num_points = b_curves.points.length();
|
||||
for (int i = 0; i < num_points; i++) {
|
||||
data[i] = get_value_at_index(i);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ATTR_ELEMENT_CURVE: {
|
||||
const int num_verts = b_curves.curves.length();
|
||||
for (int i = 0; i < num_verts; i++) {
|
||||
for (int i = 0; i < num_curves; i++) {
|
||||
data[i] = get_value_at_index(i);
|
||||
}
|
||||
break;
|
||||
|
@ -681,6 +682,7 @@ static void attr_create_motion(Hair *hair, BL::Attribute &b_attribute, const flo
|
|||
}
|
||||
|
||||
BL::FloatVectorAttribute b_vector_attribute(b_attribute);
|
||||
const float(*src)[3] = static_cast<const float(*)[3]>(b_vector_attribute.data[0].ptr.data);
|
||||
const int num_curve_keys = hair->get_curve_keys().size();
|
||||
|
||||
/* Find or add attribute */
|
||||
|
@ -698,23 +700,24 @@ static void attr_create_motion(Hair *hair, BL::Attribute &b_attribute, const flo
|
|||
float3 *mP = attr_mP->data_float3() + step * num_curve_keys;
|
||||
|
||||
for (int i = 0; i < num_curve_keys; i++) {
|
||||
mP[i] = P[i] + get_float3(b_vector_attribute.data[i].vector()) * relative_time;
|
||||
mP[i] = P[i] + make_float3(src[i][0], src[i][1], src[i][2]) * relative_time;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void attr_create_uv(AttributeSet &attributes,
|
||||
BL::Curves &b_curves,
|
||||
const int num_curves,
|
||||
const int num_points,
|
||||
BL::Attribute &b_attribute,
|
||||
const ustring name)
|
||||
{
|
||||
BL::Float2Attribute b_float2_attribute{b_attribute};
|
||||
const float(*src)[2] = static_cast<const float(*)[2]>(b_float2_attribute.data[0].ptr.data);
|
||||
Attribute *attr = attributes.add(ATTR_STD_UV, name);
|
||||
|
||||
float2 *data = attr->data_float2();
|
||||
fill_generic_attribute(b_curves, data, ATTR_ELEMENT_CURVE, [&](int i) {
|
||||
BL::Array<float, 2> v = b_float2_attribute.data[i].vector();
|
||||
return make_float2(v[0], v[1]);
|
||||
fill_generic_attribute(num_curves, num_points, data, ATTR_ELEMENT_CURVE, [&](int i) {
|
||||
return make_float2(src[i][0], src[i][1]);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -724,6 +727,9 @@ static void attr_create_generic(Scene *scene,
|
|||
const bool need_motion,
|
||||
const float motion_scale)
|
||||
{
|
||||
const int num_keys = b_curves.points.length();
|
||||
const int num_curves = b_curves.curves.length();
|
||||
|
||||
AttributeSet &attributes = hair->attributes;
|
||||
static const ustring u_velocity("velocity");
|
||||
const bool need_uv = hair->need_attribute(scene, ATTR_STD_UV);
|
||||
|
@ -743,7 +749,7 @@ static void attr_create_generic(Scene *scene,
|
|||
/* Weak, use first float2 attribute as standard UV. */
|
||||
if (need_uv && !have_uv && b_data_type == BL::Attribute::data_type_FLOAT2 &&
|
||||
b_domain == BL::Attribute::domain_CURVE) {
|
||||
attr_create_uv(attributes, b_curves, b_attribute, name);
|
||||
attr_create_uv(attributes, num_curves, num_keys, b_attribute, name);
|
||||
have_uv = true;
|
||||
continue;
|
||||
}
|
||||
|
@ -773,57 +779,70 @@ static void attr_create_generic(Scene *scene,
|
|||
switch (b_data_type) {
|
||||
case BL::Attribute::data_type_FLOAT: {
|
||||
BL::FloatAttribute b_float_attribute{b_attribute};
|
||||
const float *src = static_cast<const float *>(b_float_attribute.data[0].ptr.data);
|
||||
Attribute *attr = attributes.add(name, TypeFloat, element);
|
||||
float *data = attr->data_float();
|
||||
fill_generic_attribute(
|
||||
b_curves, data, element, [&](int i) { return b_float_attribute.data[i].value(); });
|
||||
fill_generic_attribute(num_curves, num_keys, data, element, [&](int i) { return src[i]; });
|
||||
break;
|
||||
}
|
||||
case BL::Attribute::data_type_BOOLEAN: {
|
||||
BL::BoolAttribute b_bool_attribute{b_attribute};
|
||||
const bool *src = static_cast<const bool *>(b_bool_attribute.data[0].ptr.data);
|
||||
Attribute *attr = attributes.add(name, TypeFloat, element);
|
||||
float *data = attr->data_float();
|
||||
fill_generic_attribute(b_curves, data, element, [&](int i) {
|
||||
return (float)b_bool_attribute.data[i].value();
|
||||
});
|
||||
fill_generic_attribute(
|
||||
num_curves, num_keys, data, element, [&](int i) { return float(src[i]); });
|
||||
break;
|
||||
}
|
||||
case BL::Attribute::data_type_INT: {
|
||||
BL::IntAttribute b_int_attribute{b_attribute};
|
||||
const int *src = static_cast<const int *>(b_int_attribute.data[0].ptr.data);
|
||||
Attribute *attr = attributes.add(name, TypeFloat, element);
|
||||
float *data = attr->data_float();
|
||||
fill_generic_attribute(b_curves, data, element, [&](int i) {
|
||||
return (float)b_int_attribute.data[i].value();
|
||||
});
|
||||
fill_generic_attribute(
|
||||
num_curves, num_keys, data, element, [&](int i) { return float(src[i]); });
|
||||
break;
|
||||
}
|
||||
case BL::Attribute::data_type_FLOAT_VECTOR: {
|
||||
BL::FloatVectorAttribute b_vector_attribute{b_attribute};
|
||||
const float(*src)[3] = static_cast<const float(*)[3]>(b_vector_attribute.data[0].ptr.data);
|
||||
Attribute *attr = attributes.add(name, TypeVector, element);
|
||||
float3 *data = attr->data_float3();
|
||||
fill_generic_attribute(b_curves, data, element, [&](int i) {
|
||||
BL::Array<float, 3> v = b_vector_attribute.data[i].vector();
|
||||
return make_float3(v[0], v[1], v[2]);
|
||||
fill_generic_attribute(num_curves, num_keys, data, element, [&](int i) {
|
||||
return make_float3(src[i][0], src[i][1], src[i][2]);
|
||||
});
|
||||
break;
|
||||
}
|
||||
case BL::Attribute::data_type_BYTE_COLOR: {
|
||||
BL::ByteColorAttribute b_color_attribute{b_attribute};
|
||||
const uchar(*src)[4] = static_cast<const uchar(*)[4]>(b_color_attribute.data[0].ptr.data);
|
||||
Attribute *attr = attributes.add(name, TypeRGBA, element);
|
||||
float4 *data = attr->data_float4();
|
||||
fill_generic_attribute(num_curves, num_keys, data, element, [&](int i) {
|
||||
return make_float4(color_srgb_to_linear(byte_to_float(src[i][0])),
|
||||
color_srgb_to_linear(byte_to_float(src[i][1])),
|
||||
color_srgb_to_linear(byte_to_float(src[i][2])),
|
||||
color_srgb_to_linear(byte_to_float(src[i][3])));
|
||||
});
|
||||
break;
|
||||
}
|
||||
case BL::Attribute::data_type_FLOAT_COLOR: {
|
||||
BL::FloatColorAttribute b_color_attribute{b_attribute};
|
||||
const float(*src)[4] = static_cast<const float(*)[4]>(b_color_attribute.data[0].ptr.data);
|
||||
Attribute *attr = attributes.add(name, TypeRGBA, element);
|
||||
float4 *data = attr->data_float4();
|
||||
fill_generic_attribute(b_curves, data, element, [&](int i) {
|
||||
BL::Array<float, 4> v = b_color_attribute.data[i].color();
|
||||
return make_float4(v[0], v[1], v[2], v[3]);
|
||||
fill_generic_attribute(num_curves, num_keys, data, element, [&](int i) {
|
||||
return make_float4(src[i][0], src[i][1], src[i][2], src[i][3]);
|
||||
});
|
||||
break;
|
||||
}
|
||||
case BL::Attribute::data_type_FLOAT2: {
|
||||
BL::Float2Attribute b_float2_attribute{b_attribute};
|
||||
const float(*src)[2] = static_cast<const float(*)[2]>(b_float2_attribute.data[0].ptr.data);
|
||||
Attribute *attr = attributes.add(name, TypeFloat2, element);
|
||||
float2 *data = attr->data_float2();
|
||||
fill_generic_attribute(b_curves, data, element, [&](int i) {
|
||||
BL::Array<float, 2> v = b_float2_attribute.data[i].vector();
|
||||
return make_float2(v[0], v[1]);
|
||||
fill_generic_attribute(num_curves, num_keys, data, element, [&](int i) {
|
||||
return make_float2(src[i][0], src[i][1]);
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
@ -834,27 +853,28 @@ static void attr_create_generic(Scene *scene,
|
|||
}
|
||||
}
|
||||
|
||||
static float4 hair_point_as_float4(BL::FloatVectorAttribute b_attr_position,
|
||||
std::optional<BL::FloatAttribute> b_attr_radius,
|
||||
const int index)
|
||||
static float4 curve_point_as_float4(const float (*b_attr_position)[3],
|
||||
const float *b_attr_radius,
|
||||
const int index)
|
||||
{
|
||||
float4 mP = float3_to_float4(get_float3(b_attr_position.data[index].vector()));
|
||||
mP.w = b_attr_radius ? b_attr_radius->data[index].value() : 0.005f;
|
||||
float4 mP = make_float4(
|
||||
b_attr_position[index][0], b_attr_position[index][1], b_attr_position[index][2], 0.0f);
|
||||
mP.w = b_attr_radius ? b_attr_radius[index] : 0.005f;
|
||||
return mP;
|
||||
}
|
||||
|
||||
static float4 interpolate_hair_points(BL::FloatVectorAttribute b_attr_position,
|
||||
std::optional<BL::FloatAttribute> b_attr_radius,
|
||||
const int first_point_index,
|
||||
const int num_points,
|
||||
const float step)
|
||||
static float4 interpolate_curve_points(const float (*b_attr_position)[3],
|
||||
const float *b_attr_radius,
|
||||
const int first_point_index,
|
||||
const int num_points,
|
||||
const float step)
|
||||
{
|
||||
const float curve_t = step * (num_points - 1);
|
||||
const int point_a = clamp((int)curve_t, 0, num_points - 1);
|
||||
const int point_b = min(point_a + 1, num_points - 1);
|
||||
const float t = curve_t - (float)point_a;
|
||||
return lerp(hair_point_as_float4(b_attr_position, b_attr_radius, first_point_index + point_a),
|
||||
hair_point_as_float4(b_attr_position, b_attr_radius, first_point_index + point_b),
|
||||
return lerp(curve_point_as_float4(b_attr_position, b_attr_radius, first_point_index + point_a),
|
||||
curve_point_as_float4(b_attr_position, b_attr_radius, first_point_index + point_b),
|
||||
t);
|
||||
}
|
||||
|
||||
|
@ -864,8 +884,6 @@ static void export_hair_curves(Scene *scene,
|
|||
const bool need_motion,
|
||||
const float motion_scale)
|
||||
{
|
||||
/* TODO: optimize so we can straight memcpy arrays from Blender? */
|
||||
|
||||
const int num_keys = b_curves.points.length();
|
||||
const int num_curves = b_curves.curves.length();
|
||||
|
||||
|
@ -879,7 +897,6 @@ static void export_hair_curves(Scene *scene,
|
|||
/* Add requested attributes. */
|
||||
float *attr_intercept = NULL;
|
||||
float *attr_length = NULL;
|
||||
float *attr_random = NULL;
|
||||
|
||||
if (hair->need_attribute(scene, ATTR_STD_CURVE_INTERCEPT)) {
|
||||
attr_intercept = hair->attributes.add(ATTR_STD_CURVE_INTERCEPT)->data_float();
|
||||
|
@ -888,28 +905,40 @@ static void export_hair_curves(Scene *scene,
|
|||
attr_length = hair->attributes.add(ATTR_STD_CURVE_LENGTH)->data_float();
|
||||
}
|
||||
if (hair->need_attribute(scene, ATTR_STD_CURVE_RANDOM)) {
|
||||
attr_random = hair->attributes.add(ATTR_STD_CURVE_RANDOM)->data_float();
|
||||
float *attr_random = hair->attributes.add(ATTR_STD_CURVE_RANDOM)->data_float();
|
||||
for (int i = 0; i < num_curves; i++) {
|
||||
attr_random[i] = hash_uint2_to_float(i, 0);
|
||||
}
|
||||
}
|
||||
|
||||
BL::FloatVectorAttribute b_attr_position = find_curves_position_attribute(b_curves);
|
||||
std::optional<BL::FloatAttribute> b_attr_radius = find_curves_radius_attribute(b_curves);
|
||||
const int *point_offsets = static_cast<const int *>(b_curves.curve_offset_data[0].ptr.data);
|
||||
const float(*b_attr_position)[3] = find_position_attribute(b_curves);
|
||||
const float *b_attr_radius = find_radius_attribute(b_curves);
|
||||
|
||||
std::copy(point_offsets, point_offsets + num_curves, curve_first_key);
|
||||
std::fill(curve_shader, curve_shader + num_curves, 0);
|
||||
if (b_attr_radius) {
|
||||
std::copy(b_attr_radius, b_attr_radius + num_keys, curve_radius);
|
||||
}
|
||||
else {
|
||||
std::fill(curve_radius, curve_radius + num_curves, 0.005f);
|
||||
}
|
||||
|
||||
/* Export curves and points. */
|
||||
for (int i = 0; i < num_curves; i++) {
|
||||
const int first_point_index = b_curves.curve_offset_data[i].value();
|
||||
const int num_points = b_curves.curve_offset_data[i + 1].value() - first_point_index;
|
||||
const int first_point_index = point_offsets[i];
|
||||
const int num_points = point_offsets[i + 1] - first_point_index;
|
||||
|
||||
float3 prev_co = zero_float3();
|
||||
float length = 0.0f;
|
||||
|
||||
/* Position and radius. */
|
||||
for (int j = 0; j < num_points; j++) {
|
||||
const int point_offset = first_point_index + j;
|
||||
const float3 co = get_float3(b_attr_position.data[point_offset].vector());
|
||||
const float radius = b_attr_radius ? b_attr_radius->data[point_offset].value() : 0.005f;
|
||||
const int point = first_point_index + j;
|
||||
const float3 co = make_float3(
|
||||
b_attr_position[point][0], b_attr_position[point][1], b_attr_position[point][2]);
|
||||
|
||||
curve_keys[point_offset] = co;
|
||||
curve_radius[point_offset] = radius;
|
||||
curve_keys[point] = co;
|
||||
|
||||
if (attr_length || attr_intercept) {
|
||||
if (j > 0) {
|
||||
|
@ -918,7 +947,7 @@ static void export_hair_curves(Scene *scene,
|
|||
prev_co = co;
|
||||
|
||||
if (attr_intercept) {
|
||||
attr_intercept[point_offset] = length;
|
||||
attr_intercept[point] = length;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -926,8 +955,8 @@ static void export_hair_curves(Scene *scene,
|
|||
/* Normalized 0..1 attribute along curve. */
|
||||
if (attr_intercept && length > 0.0f) {
|
||||
for (int j = 1; j < num_points; j++) {
|
||||
const int point_offset = first_point_index + j;
|
||||
attr_intercept[point_offset] /= length;
|
||||
const int point = first_point_index + j;
|
||||
attr_intercept[point] /= length;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -935,15 +964,6 @@ static void export_hair_curves(Scene *scene,
|
|||
if (attr_length) {
|
||||
attr_length[i] = length;
|
||||
}
|
||||
|
||||
/* Random number per curve. */
|
||||
if (attr_random != NULL) {
|
||||
attr_random[i] = hash_uint2_to_float(i, 0);
|
||||
}
|
||||
|
||||
/* Curve. */
|
||||
curve_shader[i] = 0;
|
||||
curve_first_key[i] = first_point_index;
|
||||
}
|
||||
|
||||
attr_create_generic(scene, hair, b_curves, need_motion, motion_scale);
|
||||
|
@ -968,12 +988,13 @@ static void export_hair_curves_motion(Hair *hair, BL::Curves b_curves, int motio
|
|||
int num_motion_keys = 0;
|
||||
int curve_index = 0;
|
||||
|
||||
BL::FloatVectorAttribute b_attr_position = find_curves_position_attribute(b_curves);
|
||||
std::optional<BL::FloatAttribute> b_attr_radius = find_curves_radius_attribute(b_curves);
|
||||
const int *point_offsets = static_cast<const int *>(b_curves.curve_offset_data[0].ptr.data);
|
||||
const float(*b_attr_position)[3] = find_position_attribute(b_curves);
|
||||
const float *b_attr_radius = find_radius_attribute(b_curves);
|
||||
|
||||
for (int i = 0; i < num_curves; i++) {
|
||||
const int first_point_index = b_curves.curve_offset_data[i].value();
|
||||
const int num_points = b_curves.curve_offset_data[i + 1].value() - first_point_index;
|
||||
const int first_point_index = point_offsets[i];
|
||||
const int num_points = point_offsets[i + 1] - first_point_index;
|
||||
|
||||
Hair::Curve curve = hair->get_curve(curve_index);
|
||||
curve_index++;
|
||||
|
@ -981,10 +1002,10 @@ static void export_hair_curves_motion(Hair *hair, BL::Curves b_curves, int motio
|
|||
if (num_points == curve.num_keys) {
|
||||
/* Number of keys matches. */
|
||||
for (int i = 0; i < num_points; i++) {
|
||||
int point_index = first_point_index + i;
|
||||
int point = first_point_index + i;
|
||||
|
||||
if (point_index < num_keys) {
|
||||
mP[num_motion_keys] = hair_point_as_float4(b_attr_position, b_attr_radius, point_index);
|
||||
if (point < num_keys) {
|
||||
mP[num_motion_keys] = curve_point_as_float4(b_attr_position, b_attr_radius, point);
|
||||
num_motion_keys++;
|
||||
|
||||
if (!have_motion) {
|
||||
|
@ -1003,7 +1024,7 @@ static void export_hair_curves_motion(Hair *hair, BL::Curves b_curves, int motio
|
|||
const float step_size = curve.num_keys > 1 ? 1.0f / (curve.num_keys - 1) : 0.0f;
|
||||
for (int i = 0; i < curve.num_keys; i++) {
|
||||
const float step = i * step_size;
|
||||
mP[num_motion_keys] = interpolate_hair_points(
|
||||
mP[num_motion_keys] = interpolate_curve_points(
|
||||
b_attr_position, b_attr_radius, first_point_index, num_points, step);
|
||||
num_motion_keys++;
|
||||
}
|
||||
|
|
|
@ -10,22 +10,12 @@
|
|||
#include "blender/sync.h"
|
||||
#include "blender/util.h"
|
||||
|
||||
#include "util/color.h"
|
||||
#include "util/foreach.h"
|
||||
#include "util/hash.h"
|
||||
|
||||
CCL_NAMESPACE_BEGIN
|
||||
|
||||
template<typename TypeInCycles, typename GetValueAtIndex>
|
||||
static void fill_generic_attribute(BL::PointCloud &b_pointcloud,
|
||||
TypeInCycles *data,
|
||||
const GetValueAtIndex &get_value_at_index)
|
||||
{
|
||||
const int num_points = b_pointcloud.points.length();
|
||||
for (int i = 0; i < num_points; i++) {
|
||||
data[i] = get_value_at_index(i);
|
||||
}
|
||||
}
|
||||
|
||||
static void attr_create_motion(PointCloud *pointcloud,
|
||||
BL::Attribute &b_attribute,
|
||||
const float motion_scale)
|
||||
|
@ -63,6 +53,11 @@ static void copy_attributes(PointCloud *pointcloud,
|
|||
const bool need_motion,
|
||||
const float motion_scale)
|
||||
{
|
||||
const int num_points = b_pointcloud.points.length();
|
||||
if (num_points == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
AttributeSet &attributes = pointcloud->attributes;
|
||||
static const ustring u_velocity("velocity");
|
||||
for (BL::Attribute &b_attribute : b_pointcloud.attributes) {
|
||||
|
@ -81,56 +76,73 @@ static void copy_attributes(PointCloud *pointcloud,
|
|||
switch (b_data_type) {
|
||||
case BL::Attribute::data_type_FLOAT: {
|
||||
BL::FloatAttribute b_float_attribute{b_attribute};
|
||||
const float *src = static_cast<const float *>(b_float_attribute.data[0].ptr.data);
|
||||
Attribute *attr = attributes.add(name, TypeFloat, element);
|
||||
float *data = attr->data_float();
|
||||
fill_generic_attribute(
|
||||
b_pointcloud, data, [&](int i) { return b_float_attribute.data[i].value(); });
|
||||
std::copy(src, src + num_points, data);
|
||||
break;
|
||||
}
|
||||
case BL::Attribute::data_type_BOOLEAN: {
|
||||
BL::BoolAttribute b_bool_attribute{b_attribute};
|
||||
const bool *src = static_cast<const bool *>(b_bool_attribute.data[0].ptr.data);
|
||||
Attribute *attr = attributes.add(name, TypeFloat, element);
|
||||
float *data = attr->data_float();
|
||||
fill_generic_attribute(
|
||||
b_pointcloud, data, [&](int i) { return (float)b_bool_attribute.data[i].value(); });
|
||||
for (int i = 0; i < num_points; i++) {
|
||||
data[i] = float(src[i]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case BL::Attribute::data_type_INT: {
|
||||
BL::IntAttribute b_int_attribute{b_attribute};
|
||||
const int *src = static_cast<const int *>(b_int_attribute.data[0].ptr.data);
|
||||
Attribute *attr = attributes.add(name, TypeFloat, element);
|
||||
float *data = attr->data_float();
|
||||
fill_generic_attribute(
|
||||
b_pointcloud, data, [&](int i) { return (float)b_int_attribute.data[i].value(); });
|
||||
for (int i = 0; i < num_points; i++) {
|
||||
data[i] = float(src[i]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case BL::Attribute::data_type_FLOAT_VECTOR: {
|
||||
BL::FloatVectorAttribute b_vector_attribute{b_attribute};
|
||||
const float(*src)[3] = static_cast<const float(*)[3]>(b_vector_attribute.data[0].ptr.data);
|
||||
Attribute *attr = attributes.add(name, TypeVector, element);
|
||||
float3 *data = attr->data_float3();
|
||||
fill_generic_attribute(b_pointcloud, data, [&](int i) {
|
||||
BL::Array<float, 3> v = b_vector_attribute.data[i].vector();
|
||||
return make_float3(v[0], v[1], v[2]);
|
||||
});
|
||||
for (int i = 0; i < num_points; i++) {
|
||||
data[i] = make_float3(src[i][0], src[i][1], src[i][2]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case BL::Attribute::data_type_BYTE_COLOR: {
|
||||
BL::ByteColorAttribute b_color_attribute{b_attribute};
|
||||
const uchar(*src)[4] = static_cast<const uchar(*)[4]>(b_color_attribute.data[0].ptr.data);
|
||||
Attribute *attr = attributes.add(name, TypeRGBA, element);
|
||||
float4 *data = attr->data_float4();
|
||||
for (int i = 0; i < num_points; i++) {
|
||||
data[i] = make_float4(color_srgb_to_linear(byte_to_float(src[i][0])),
|
||||
color_srgb_to_linear(byte_to_float(src[i][1])),
|
||||
color_srgb_to_linear(byte_to_float(src[i][2])),
|
||||
color_srgb_to_linear(byte_to_float(src[i][3])));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case BL::Attribute::data_type_FLOAT_COLOR: {
|
||||
BL::FloatColorAttribute b_color_attribute{b_attribute};
|
||||
const float(*src)[4] = static_cast<const float(*)[4]>(b_color_attribute.data[0].ptr.data);
|
||||
Attribute *attr = attributes.add(name, TypeRGBA, element);
|
||||
float4 *data = attr->data_float4();
|
||||
fill_generic_attribute(b_pointcloud, data, [&](int i) {
|
||||
BL::Array<float, 4> v = b_color_attribute.data[i].color();
|
||||
return make_float4(v[0], v[1], v[2], v[3]);
|
||||
});
|
||||
for (int i = 0; i < num_points; i++) {
|
||||
data[i] = make_float4(src[i][0], src[i][1], src[i][2], src[i][3]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case BL::Attribute::data_type_FLOAT2: {
|
||||
BL::Float2Attribute b_float2_attribute{b_attribute};
|
||||
const float(*src)[2] = static_cast<const float(*)[2]>(b_float2_attribute.data[0].ptr.data);
|
||||
Attribute *attr = attributes.add(name, TypeFloat2, element);
|
||||
float2 *data = attr->data_float2();
|
||||
fill_generic_attribute(b_pointcloud, data, [&](int i) {
|
||||
BL::Array<float, 2> v = b_float2_attribute.data[i].vector();
|
||||
return make_float2(v[0], v[1]);
|
||||
});
|
||||
for (int i = 0; i < num_points; i++) {
|
||||
data[i] = make_float2(src[i][0], src[i][1]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
@ -140,7 +152,7 @@ static void copy_attributes(PointCloud *pointcloud,
|
|||
}
|
||||
}
|
||||
|
||||
static std::optional<BL::FloatAttribute> find_radius_attribute(BL::PointCloud b_pointcloud)
|
||||
static const float *find_radius_attribute(BL::PointCloud b_pointcloud)
|
||||
{
|
||||
for (BL::Attribute &b_attribute : b_pointcloud.attributes) {
|
||||
if (b_attribute.name() != "radius") {
|
||||
|
@ -149,12 +161,16 @@ static std::optional<BL::FloatAttribute> find_radius_attribute(BL::PointCloud b_
|
|||
if (b_attribute.data_type() != BL::Attribute::data_type_FLOAT) {
|
||||
continue;
|
||||
}
|
||||
return BL::FloatAttribute{b_attribute};
|
||||
BL::FloatAttribute b_float_attribute{b_attribute};
|
||||
if (b_float_attribute.data.length() == 0) {
|
||||
return nullptr;
|
||||
}
|
||||
return static_cast<const float *>(b_float_attribute.data[0].ptr.data);
|
||||
}
|
||||
return std::nullopt;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
static BL::FloatVectorAttribute find_position_attribute(BL::PointCloud b_pointcloud)
|
||||
static const float (*find_position_attribute(BL::PointCloud b_pointcloud))[3]
|
||||
{
|
||||
for (BL::Attribute &b_attribute : b_pointcloud.attributes) {
|
||||
if (b_attribute.name() != "position") {
|
||||
|
@ -163,11 +179,15 @@ static BL::FloatVectorAttribute find_position_attribute(BL::PointCloud b_pointcl
|
|||
if (b_attribute.data_type() != BL::Attribute::data_type_FLOAT_VECTOR) {
|
||||
continue;
|
||||
}
|
||||
return BL::FloatVectorAttribute{b_attribute};
|
||||
BL::FloatVectorAttribute b_float3_attribute{b_attribute};
|
||||
if (b_float3_attribute.data.length() == 0) {
|
||||
return nullptr;
|
||||
}
|
||||
return static_cast<const float(*)[3]>(b_float3_attribute.data[0].ptr.data);
|
||||
}
|
||||
/* The position attribute must exist. */
|
||||
assert(false);
|
||||
return BL::FloatVectorAttribute{b_pointcloud.attributes[0]};
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
static void export_pointcloud(Scene *scene,
|
||||
|
@ -176,34 +196,36 @@ static void export_pointcloud(Scene *scene,
|
|||
const bool need_motion,
|
||||
const float motion_scale)
|
||||
{
|
||||
/* TODO: optimize so we can straight memcpy arrays from Blender? */
|
||||
const int num_points = b_pointcloud.points.length();
|
||||
pointcloud->resize(num_points);
|
||||
|
||||
/* Add requested attributes. */
|
||||
Attribute *attr_random = NULL;
|
||||
if (pointcloud->need_attribute(scene, ATTR_STD_POINT_RANDOM)) {
|
||||
attr_random = pointcloud->attributes.add(ATTR_STD_POINT_RANDOM);
|
||||
const float(*b_attr_position)[3] = find_position_attribute(b_pointcloud);
|
||||
float3 *points = pointcloud->get_points().data();
|
||||
|
||||
for (int i = 0; i < num_points; i++) {
|
||||
points[i] = make_float3(b_attr_position[i][0], b_attr_position[i][1], b_attr_position[i][2]);
|
||||
}
|
||||
|
||||
/* Reserve memory. */
|
||||
const int num_points = b_pointcloud.points.length();
|
||||
pointcloud->reserve(num_points);
|
||||
const float *b_attr_radius = find_radius_attribute(b_pointcloud);
|
||||
float *radius = pointcloud->get_radius().data();
|
||||
if (b_attr_radius) {
|
||||
std::copy(b_attr_radius, b_attr_radius + num_points, radius);
|
||||
}
|
||||
else {
|
||||
std::fill(radius, radius + num_points, 0.01f);
|
||||
}
|
||||
|
||||
BL::FloatVectorAttribute b_attr_position = find_position_attribute(b_pointcloud);
|
||||
std::optional<BL::FloatAttribute> b_attr_radius = find_radius_attribute(b_pointcloud);
|
||||
int *shader = pointcloud->get_shader().data();
|
||||
std::fill(shader, shader + num_points, 0);
|
||||
|
||||
/* Export points. */
|
||||
for (int i = 0; i < num_points; i++) {
|
||||
const float3 co = get_float3(b_attr_position.data[i].vector());
|
||||
const float radius = b_attr_radius ? b_attr_radius->data[i].value() : 0.01f;
|
||||
pointcloud->add_point(co, radius);
|
||||
|
||||
/* Random number per point. */
|
||||
if (attr_random != NULL) {
|
||||
attr_random->add(hash_uint2_to_float(i, 0));
|
||||
if (pointcloud->need_attribute(scene, ATTR_STD_POINT_RANDOM)) {
|
||||
Attribute *attr_random = pointcloud->attributes.add(ATTR_STD_POINT_RANDOM);
|
||||
float *data = attr_random->data_float();
|
||||
for (int i = 0; i < num_points; i++) {
|
||||
data[i] = hash_uint2_to_float(i, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/* Export attributes */
|
||||
copy_attributes(pointcloud, b_pointcloud, need_motion, motion_scale);
|
||||
}
|
||||
|
||||
|
@ -220,22 +242,22 @@ static void export_pointcloud_motion(PointCloud *pointcloud,
|
|||
new_attribute = true;
|
||||
}
|
||||
|
||||
/* Export motion points. */
|
||||
const int num_points = pointcloud->num_points();
|
||||
// Point cloud attributes are stored as float4 with the radius
|
||||
// in the w element. This is explict now as float3 is no longer
|
||||
// interchangeable with float4 as it is packed now.
|
||||
/* Point cloud attributes are stored as float4 with the radius in the w element.
|
||||
* This is explict now as float3 is no longer interchangeable with float4 as it
|
||||
* is packed now. */
|
||||
float4 *mP = attr_mP->data_float4() + motion_step * num_points;
|
||||
bool have_motion = false;
|
||||
const array<float3> &pointcloud_points = pointcloud->get_points();
|
||||
|
||||
const int b_points_num = b_pointcloud.points.length();
|
||||
BL::FloatVectorAttribute b_attr_position = find_position_attribute(b_pointcloud);
|
||||
std::optional<BL::FloatAttribute> b_attr_radius = find_radius_attribute(b_pointcloud);
|
||||
const float(*b_attr_position)[3] = find_position_attribute(b_pointcloud);
|
||||
const float *b_attr_radius = find_radius_attribute(b_pointcloud);
|
||||
|
||||
for (int i = 0; i < std::min(num_points, b_points_num); i++) {
|
||||
const float3 P = get_float3(b_attr_position.data[i].vector());
|
||||
const float radius = b_attr_radius ? b_attr_radius->data[i].value() : 0.01f;
|
||||
const float3 P = make_float3(
|
||||
b_attr_position[i][0], b_attr_position[i][1], b_attr_position[i][2]);
|
||||
const float radius = b_attr_radius ? b_attr_radius[i] : 0.01f;
|
||||
mP[i] = make_float4(P.x, P.y, P.z, radius);
|
||||
have_motion = have_motion || (P != pointcloud_points[i]);
|
||||
}
|
||||
|
@ -277,7 +299,7 @@ void BlenderSync::sync_pointcloud(PointCloud *pointcloud, BObjectInfo &b_ob_info
|
|||
0.0f;
|
||||
export_pointcloud(scene, &new_pointcloud, b_pointcloud, need_motion, motion_scale);
|
||||
|
||||
/* update original sockets */
|
||||
/* Update original sockets. */
|
||||
for (const SocketType &socket : new_pointcloud.type->inputs) {
|
||||
/* Those sockets are updated in sync_object, so do not modify them. */
|
||||
if (socket.name == "use_motion_blur" || socket.name == "motion_steps" ||
|
||||
|
@ -292,7 +314,7 @@ void BlenderSync::sync_pointcloud(PointCloud *pointcloud, BObjectInfo &b_ob_info
|
|||
pointcloud->attributes.attributes.push_back(std::move(attr));
|
||||
}
|
||||
|
||||
/* tag update */
|
||||
/* Tag update. */
|
||||
const bool rebuild = (pointcloud && old_numpoints != pointcloud->num_points());
|
||||
pointcloud->tag_update(scene, rebuild);
|
||||
}
|
||||
|
|
|
@ -445,12 +445,10 @@ void MetalKernelPipeline::compile()
|
|||
const std::string function_name = std::string("cycles_metal_") +
|
||||
device_kernel_as_string(device_kernel);
|
||||
|
||||
NSString *entryPoint = [@(function_name.c_str()) copy];
|
||||
|
||||
NSError *error = NULL;
|
||||
if (@available(macOS 11.0, *)) {
|
||||
MTLFunctionDescriptor *func_desc = [MTLIntersectionFunctionDescriptor functionDescriptor];
|
||||
func_desc.name = entryPoint;
|
||||
func_desc.name = [@(function_name.c_str()) copy];
|
||||
|
||||
if (pso_type != PSO_GENERIC) {
|
||||
func_desc.constantValues = GetConstantValues(&kernel_data_);
|
||||
|
@ -462,8 +460,6 @@ void MetalKernelPipeline::compile()
|
|||
function = [mtlLibrary newFunctionWithDescriptor:func_desc error:&error];
|
||||
}
|
||||
|
||||
[entryPoint release];
|
||||
|
||||
if (function == nil) {
|
||||
NSString *err = [error localizedDescription];
|
||||
string errors = [err UTF8String];
|
||||
|
@ -471,7 +467,7 @@ void MetalKernelPipeline::compile()
|
|||
return;
|
||||
}
|
||||
|
||||
function.label = [entryPoint copy];
|
||||
function.label = [@(function_name.c_str()) copy];
|
||||
|
||||
if (use_metalrt) {
|
||||
if (@available(macOS 11.0, *)) {
|
||||
|
|
|
@ -80,6 +80,12 @@ if(EXISTS ${USD_INCLUDE_DIR}/pxr/imaging/hgiGL)
|
|||
list(APPEND SRC_HD_CYCLES_HEADERS display_driver.h)
|
||||
endif()
|
||||
|
||||
# Silence warning from USD headers using deprecated TBB header.
|
||||
add_definitions(
|
||||
-D__TBB_show_deprecation_message_atomic_H
|
||||
-D__TBB_show_deprecation_message_task_H
|
||||
)
|
||||
|
||||
include_directories(${INC})
|
||||
include_directories(SYSTEM ${INC_SYS})
|
||||
|
||||
|
|
|
@ -4,6 +4,12 @@
|
|||
|
||||
#ifdef _WIN32
|
||||
// Include first to avoid "NOGDI" definition set in Cycles headers
|
||||
# ifndef NOMINMAX
|
||||
# define NOMINMAX
|
||||
# endif
|
||||
# ifndef WIN32_LEAN_AND_MEAN
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# endif
|
||||
# include <Windows.h>
|
||||
#endif
|
||||
|
||||
|
|
|
@ -370,6 +370,16 @@ VtValue convertFromCyclesArray(const array<SrcType> &value)
|
|||
return VtValue(convertedValue);
|
||||
}
|
||||
|
||||
template<> VtValue convertFromCyclesArray<float2, GfVec2f>(const array<float2> &value)
|
||||
{
|
||||
VtVec2fArray convertedValue;
|
||||
convertedValue.reserve(value.size());
|
||||
for (const auto &element : value) {
|
||||
convertedValue.push_back(GfVec2f(element.x, element.y));
|
||||
}
|
||||
return VtValue(convertedValue);
|
||||
}
|
||||
|
||||
template<> VtValue convertFromCyclesArray<float3, GfVec3f>(const array<float3> &value)
|
||||
{
|
||||
VtVec3fArray convertedValue;
|
||||
|
|
|
@ -109,6 +109,11 @@ class PassAccessor {
|
|||
/* Set pass data for the given render buffers. Used for baking to read from passes. */
|
||||
bool set_render_tile_pixels(RenderBuffers *render_buffers, const Source &source);
|
||||
|
||||
const PassAccessInfo &get_pass_access_info() const
|
||||
{
|
||||
return pass_access_info_;
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual void init_kernel_film_convert(KernelFilmConvert *kfilm_convert,
|
||||
const BufferParams &buffer_params,
|
||||
|
|
|
@ -1036,7 +1036,12 @@ bool PathTrace::get_render_tile_pixels(const PassAccessor &pass_accessor,
|
|||
}
|
||||
|
||||
if (big_tile_denoise_work_ && render_state_.has_denoised_result) {
|
||||
return big_tile_denoise_work_->get_render_tile_pixels(pass_accessor, destination);
|
||||
/* Only use the big tile denoised buffer to access the denoised passes.
|
||||
* The guiding passes are allowed to be modified in-place for the needs of the denoiser,
|
||||
* so copy those from the original devices buffers. */
|
||||
if (pass_accessor.get_pass_access_info().mode == PassMode::DENOISED) {
|
||||
return big_tile_denoise_work_->get_render_tile_pixels(pass_accessor, destination);
|
||||
}
|
||||
}
|
||||
|
||||
bool success = true;
|
||||
|
|
|
@ -74,57 +74,43 @@ ccl_device_inline void motion_triangle_normals_for_step(KernelGlobals kg,
|
|||
}
|
||||
}
|
||||
|
||||
ccl_device_inline void motion_triangle_vertices(
|
||||
KernelGlobals kg, int object, int prim, float time, float3 verts[3])
|
||||
ccl_device_inline void motion_triangle_compute_info(KernelGlobals kg,
|
||||
int object,
|
||||
float time,
|
||||
int prim,
|
||||
ccl_private uint3 *tri_vindex,
|
||||
ccl_private int *numsteps,
|
||||
ccl_private int *numverts,
|
||||
ccl_private int *step,
|
||||
ccl_private float *t)
|
||||
{
|
||||
/* get motion info */
|
||||
int numsteps, numverts;
|
||||
object_motion_info(kg, object, &numsteps, &numverts, NULL);
|
||||
|
||||
/* figure out which steps we need to fetch and their interpolation factor */
|
||||
int maxstep = numsteps * 2;
|
||||
int step = min((int)(time * maxstep), maxstep - 1);
|
||||
float t = time * maxstep - step;
|
||||
|
||||
/* find attribute */
|
||||
int offset = intersection_find_attribute(kg, object, ATTR_STD_MOTION_VERTEX_POSITION);
|
||||
kernel_assert(offset != ATTR_STD_NOT_FOUND);
|
||||
|
||||
/* fetch vertex coordinates */
|
||||
float3 next_verts[3];
|
||||
|
||||
uint3 tri_vindex = kernel_data_fetch(tri_vindex, prim);
|
||||
|
||||
motion_triangle_verts_for_step(kg, tri_vindex, offset, numverts, numsteps, step, verts);
|
||||
motion_triangle_verts_for_step(kg, tri_vindex, offset, numverts, numsteps, step + 1, next_verts);
|
||||
|
||||
/* interpolate between steps */
|
||||
verts[0] = (1.0f - t) * verts[0] + t * next_verts[0];
|
||||
verts[1] = (1.0f - t) * verts[1] + t * next_verts[1];
|
||||
verts[2] = (1.0f - t) * verts[2] + t * next_verts[2];
|
||||
}
|
||||
|
||||
ccl_device_inline void motion_triangle_vertices_and_normals(
|
||||
KernelGlobals kg, int object, int prim, float time, float3 verts[3], float3 normals[3])
|
||||
{
|
||||
/* get motion info */
|
||||
int numsteps, numverts;
|
||||
object_motion_info(kg, object, &numsteps, &numverts, NULL);
|
||||
/* Get object motion info. */
|
||||
object_motion_info(kg, object, numsteps, numverts, NULL);
|
||||
|
||||
/* Figure out which steps we need to fetch and their interpolation factor. */
|
||||
int maxstep = numsteps * 2;
|
||||
int step = min((int)(time * maxstep), maxstep - 1);
|
||||
float t = time * maxstep - step;
|
||||
int maxstep = *numsteps * 2;
|
||||
*step = min((int)(time * maxstep), maxstep - 1);
|
||||
*t = time * maxstep - *step;
|
||||
|
||||
/* Get triangle indices. */
|
||||
*tri_vindex = kernel_data_fetch(tri_vindex, prim);
|
||||
}
|
||||
|
||||
ccl_device_inline void motion_triangle_vertices(KernelGlobals kg,
|
||||
int object,
|
||||
uint3 tri_vindex,
|
||||
int numsteps,
|
||||
int numverts,
|
||||
int step,
|
||||
float t,
|
||||
float3 verts[3])
|
||||
{
|
||||
/* Find attribute. */
|
||||
int offset = intersection_find_attribute(kg, object, ATTR_STD_MOTION_VERTEX_POSITION);
|
||||
kernel_assert(offset != ATTR_STD_NOT_FOUND);
|
||||
|
||||
/* Fetch vertex coordinates. */
|
||||
float3 next_verts[3];
|
||||
|
||||
uint3 tri_vindex = kernel_data_fetch(tri_vindex, prim);
|
||||
|
||||
motion_triangle_verts_for_step(kg, tri_vindex, offset, numverts, numsteps, step, verts);
|
||||
motion_triangle_verts_for_step(kg, tri_vindex, offset, numverts, numsteps, step + 1, next_verts);
|
||||
|
||||
|
@ -132,60 +118,90 @@ ccl_device_inline void motion_triangle_vertices_and_normals(
|
|||
verts[0] = (1.0f - t) * verts[0] + t * next_verts[0];
|
||||
verts[1] = (1.0f - t) * verts[1] + t * next_verts[1];
|
||||
verts[2] = (1.0f - t) * verts[2] + t * next_verts[2];
|
||||
}
|
||||
|
||||
/* Compute smooth normal. */
|
||||
ccl_device_inline void motion_triangle_vertices(
|
||||
KernelGlobals kg, int object, int prim, float time, float3 verts[3])
|
||||
{
|
||||
int numsteps, numverts, step;
|
||||
float t;
|
||||
uint3 tri_vindex;
|
||||
motion_triangle_compute_info(
|
||||
kg, object, time, prim, &tri_vindex, &numsteps, &numverts, &step, &t);
|
||||
|
||||
motion_triangle_vertices(kg, object, tri_vindex, numsteps, numverts, step, t, verts);
|
||||
}
|
||||
|
||||
ccl_device_inline void motion_triangle_normals(KernelGlobals kg,
|
||||
int object,
|
||||
uint3 tri_vindex,
|
||||
int numsteps,
|
||||
int numverts,
|
||||
int step,
|
||||
float t,
|
||||
float3 normals[3])
|
||||
{
|
||||
/* Find attribute. */
|
||||
offset = intersection_find_attribute(kg, object, ATTR_STD_MOTION_VERTEX_NORMAL);
|
||||
int offset = intersection_find_attribute(kg, object, ATTR_STD_MOTION_VERTEX_NORMAL);
|
||||
kernel_assert(offset != ATTR_STD_NOT_FOUND);
|
||||
|
||||
/* Fetch vertex coordinates. */
|
||||
/* Fetch normals. */
|
||||
float3 next_normals[3];
|
||||
motion_triangle_normals_for_step(kg, tri_vindex, offset, numverts, numsteps, step, normals);
|
||||
motion_triangle_normals_for_step(
|
||||
kg, tri_vindex, offset, numverts, numsteps, step + 1, next_normals);
|
||||
|
||||
/* Interpolate between steps. */
|
||||
normals[0] = (1.0f - t) * normals[0] + t * next_normals[0];
|
||||
normals[1] = (1.0f - t) * normals[1] + t * next_normals[1];
|
||||
normals[2] = (1.0f - t) * normals[2] + t * next_normals[2];
|
||||
normals[0] = normalize((1.0f - t) * normals[0] + t * next_normals[0]);
|
||||
normals[1] = normalize((1.0f - t) * normals[1] + t * next_normals[1]);
|
||||
normals[2] = normalize((1.0f - t) * normals[2] + t * next_normals[2]);
|
||||
}
|
||||
|
||||
ccl_device_inline void motion_triangle_vertices_and_normals(
|
||||
KernelGlobals kg, int object, int prim, float time, float3 verts[3], float3 normals[3])
|
||||
{
|
||||
int numsteps, numverts, step;
|
||||
float t;
|
||||
uint3 tri_vindex;
|
||||
motion_triangle_compute_info(
|
||||
kg, object, time, prim, &tri_vindex, &numsteps, &numverts, &step, &t);
|
||||
|
||||
motion_triangle_vertices(kg, object, tri_vindex, numsteps, numverts, step, t, verts);
|
||||
motion_triangle_normals(kg, object, tri_vindex, numsteps, numverts, step, t, normals);
|
||||
}
|
||||
|
||||
ccl_device_inline float3 motion_triangle_smooth_normal(KernelGlobals kg,
|
||||
float3 Ng,
|
||||
int object,
|
||||
uint3 tri_vindex,
|
||||
int numsteps,
|
||||
int numverts,
|
||||
int step,
|
||||
float t,
|
||||
float u,
|
||||
float v)
|
||||
{
|
||||
float3 normals[3];
|
||||
motion_triangle_normals(kg, object, tri_vindex, numsteps, numverts, step, t, normals);
|
||||
|
||||
/* Interpolate between normals. */
|
||||
float w = 1.0f - u - v;
|
||||
float3 N = safe_normalize(w * normals[0] + u * normals[1] + v * normals[2]);
|
||||
|
||||
return is_zero(N) ? Ng : N;
|
||||
}
|
||||
|
||||
ccl_device_inline float3 motion_triangle_smooth_normal(
|
||||
KernelGlobals kg, float3 Ng, int object, int prim, float u, float v, float time)
|
||||
{
|
||||
/* get motion info */
|
||||
int numsteps, numverts;
|
||||
object_motion_info(kg, object, &numsteps, &numverts, NULL);
|
||||
int numsteps, numverts, step;
|
||||
float t;
|
||||
uint3 tri_vindex;
|
||||
motion_triangle_compute_info(
|
||||
kg, object, time, prim, &tri_vindex, &numsteps, &numverts, &step, &t);
|
||||
|
||||
/* figure out which steps we need to fetch and their interpolation factor */
|
||||
int maxstep = numsteps * 2;
|
||||
int step = min((int)(time * maxstep), maxstep - 1);
|
||||
float t = time * maxstep - step;
|
||||
|
||||
/* find attribute */
|
||||
int offset = intersection_find_attribute(kg, object, ATTR_STD_MOTION_VERTEX_NORMAL);
|
||||
kernel_assert(offset != ATTR_STD_NOT_FOUND);
|
||||
|
||||
/* fetch normals */
|
||||
float3 normals[3], next_normals[3];
|
||||
|
||||
uint3 tri_vindex = kernel_data_fetch(tri_vindex, prim);
|
||||
|
||||
motion_triangle_normals_for_step(kg, tri_vindex, offset, numverts, numsteps, step, normals);
|
||||
motion_triangle_normals_for_step(
|
||||
kg, tri_vindex, offset, numverts, numsteps, step + 1, next_normals);
|
||||
|
||||
/* interpolate between steps */
|
||||
normals[0] = (1.0f - t) * normals[0] + t * next_normals[0];
|
||||
normals[1] = (1.0f - t) * normals[1] + t * next_normals[1];
|
||||
normals[2] = (1.0f - t) * normals[2] + t * next_normals[2];
|
||||
|
||||
/* interpolate between vertices */
|
||||
float w = 1.0f - u - v;
|
||||
float3 N = safe_normalize(u * normals[0] + v * normals[1] + w * normals[2]);
|
||||
|
||||
return is_zero(N) ? Ng : N;
|
||||
return motion_triangle_smooth_normal(
|
||||
kg, Ng, object, tri_vindex, numsteps, numverts, step, t, u, v);
|
||||
}
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
|
|
@ -32,30 +32,17 @@ ccl_device_noinline void motion_triangle_shader_setup(KernelGlobals kg,
|
|||
{
|
||||
/* Get shader. */
|
||||
sd->shader = kernel_data_fetch(tri_shader, sd->prim);
|
||||
/* Get motion info. */
|
||||
/* TODO(sergey): This logic is really similar to motion_triangle_vertices(),
|
||||
* can we de-duplicate something here?
|
||||
*/
|
||||
int numsteps, numverts;
|
||||
object_motion_info(kg, sd->object, &numsteps, &numverts, NULL);
|
||||
/* Figure out which steps we need to fetch and their interpolation factor. */
|
||||
int maxstep = numsteps * 2;
|
||||
int step = min((int)(sd->time * maxstep), maxstep - 1);
|
||||
float t = sd->time * maxstep - step;
|
||||
/* Find attribute. */
|
||||
int offset = intersection_find_attribute(kg, sd->object, ATTR_STD_MOTION_VERTEX_POSITION);
|
||||
kernel_assert(offset != ATTR_STD_NOT_FOUND);
|
||||
/* Fetch vertex coordinates. */
|
||||
float3 verts[3], next_verts[3];
|
||||
|
||||
uint3 tri_vindex = kernel_data_fetch(tri_vindex, sd->prim);
|
||||
/* Compute motion info. */
|
||||
int numsteps, numverts, step;
|
||||
float t;
|
||||
uint3 tri_vindex;
|
||||
motion_triangle_compute_info(
|
||||
kg, sd->object, sd->time, sd->prim, &tri_vindex, &numsteps, &numverts, &step, &t);
|
||||
|
||||
float3 verts[3];
|
||||
motion_triangle_vertices(kg, sd->object, tri_vindex, numsteps, numverts, step, t, verts);
|
||||
|
||||
motion_triangle_verts_for_step(kg, tri_vindex, offset, numverts, numsteps, step, verts);
|
||||
motion_triangle_verts_for_step(kg, tri_vindex, offset, numverts, numsteps, step + 1, next_verts);
|
||||
/* Interpolate between steps. */
|
||||
verts[0] = (1.0f - t) * verts[0] + t * next_verts[0];
|
||||
verts[1] = (1.0f - t) * verts[1] + t * next_verts[1];
|
||||
verts[2] = (1.0f - t) * verts[2] + t * next_verts[2];
|
||||
/* Compute refined position. */
|
||||
sd->P = motion_triangle_point_from_uv(kg, sd, isect_object, isect_prim, sd->u, sd->v, verts);
|
||||
/* Compute face normal. */
|
||||
|
@ -75,23 +62,8 @@ ccl_device_noinline void motion_triangle_shader_setup(KernelGlobals kg,
|
|||
#endif
|
||||
/* Compute smooth normal. */
|
||||
if (sd->shader & SHADER_SMOOTH_NORMAL) {
|
||||
/* Find attribute. */
|
||||
int offset = intersection_find_attribute(kg, sd->object, ATTR_STD_MOTION_VERTEX_NORMAL);
|
||||
kernel_assert(offset != ATTR_STD_NOT_FOUND);
|
||||
/* Fetch vertex coordinates. */
|
||||
float3 normals[3], next_normals[3];
|
||||
motion_triangle_normals_for_step(kg, tri_vindex, offset, numverts, numsteps, step, normals);
|
||||
motion_triangle_normals_for_step(
|
||||
kg, tri_vindex, offset, numverts, numsteps, step + 1, next_normals);
|
||||
/* Interpolate between steps. */
|
||||
normals[0] = (1.0f - t) * normals[0] + t * next_normals[0];
|
||||
normals[1] = (1.0f - t) * normals[1] + t * next_normals[1];
|
||||
normals[2] = (1.0f - t) * normals[2] + t * next_normals[2];
|
||||
/* Interpolate between vertices. */
|
||||
float u = sd->u;
|
||||
float v = sd->v;
|
||||
float w = 1.0f - u - v;
|
||||
sd->N = (w * normals[0] + u * normals[1] + v * normals[2]);
|
||||
sd->N = motion_triangle_smooth_normal(
|
||||
kg, Ng, sd->object, tri_vindex, numsteps, numverts, step, t, sd->u, sd->v);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ ccl_device_noinline int svm_node_tex_coord(KernelGlobals kg,
|
|||
uint4 node,
|
||||
int offset)
|
||||
{
|
||||
float3 data;
|
||||
float3 data = zero_float3();
|
||||
uint type = node.y;
|
||||
uint out_offset = node.z;
|
||||
|
||||
|
@ -100,7 +100,7 @@ ccl_device_noinline int svm_node_tex_coord_bump_dx(KernelGlobals kg,
|
|||
int offset)
|
||||
{
|
||||
#ifdef __RAY_DIFFERENTIALS__
|
||||
float3 data;
|
||||
float3 data = zero_float3();
|
||||
uint type = node.y;
|
||||
uint out_offset = node.z;
|
||||
|
||||
|
@ -185,7 +185,7 @@ ccl_device_noinline int svm_node_tex_coord_bump_dy(KernelGlobals kg,
|
|||
int offset)
|
||||
{
|
||||
#ifdef __RAY_DIFFERENTIALS__
|
||||
float3 data;
|
||||
float3 data = zero_float3();
|
||||
uint type = node.y;
|
||||
uint out_offset = node.z;
|
||||
|
||||
|
|
|
@ -247,13 +247,16 @@ size_t CachedData::memory_used() const
|
|||
static M44d convert_yup_zup(const M44d &mtx, float scale_mult)
|
||||
{
|
||||
V3d scale, shear, rotation, translation;
|
||||
extractSHRT(mtx,
|
||||
scale,
|
||||
shear,
|
||||
rotation,
|
||||
translation,
|
||||
true,
|
||||
IMATH_INTERNAL_NAMESPACE::Euler<double>::XZY);
|
||||
|
||||
if (!extractSHRT(mtx,
|
||||
scale,
|
||||
shear,
|
||||
rotation,
|
||||
translation,
|
||||
true,
|
||||
IMATH_INTERNAL_NAMESPACE::Euler<double>::XZY)) {
|
||||
return mtx;
|
||||
}
|
||||
|
||||
M44d rot_mat, scale_mat, trans_mat;
|
||||
rot_mat.setEulerAngles(V3d(rotation.x, -rotation.z, rotation.y));
|
||||
|
|
|
@ -531,7 +531,7 @@ PrimitiveType Hair::primitive_type() const
|
|||
|
||||
/* Fill in coordinates for curve transparency shader evaluation on device. */
|
||||
static int fill_shader_input(const Hair *hair,
|
||||
const int object_index,
|
||||
const size_t object_index,
|
||||
device_vector<KernelShaderEvalInput> &d_input)
|
||||
{
|
||||
int d_input_size = 0;
|
||||
|
|
|
@ -86,7 +86,7 @@ ImageHandle::ImageHandle(const ImageHandle &other)
|
|||
: tile_slots(other.tile_slots), manager(other.manager)
|
||||
{
|
||||
/* Increase image user count. */
|
||||
foreach (const int slot, tile_slots) {
|
||||
foreach (const size_t slot, tile_slots) {
|
||||
manager->add_image_user(slot);
|
||||
}
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ ImageHandle &ImageHandle::operator=(const ImageHandle &other)
|
|||
manager = other.manager;
|
||||
tile_slots = other.tile_slots;
|
||||
|
||||
foreach (const int slot, tile_slots) {
|
||||
foreach (const size_t slot, tile_slots) {
|
||||
manager->add_image_user(slot);
|
||||
}
|
||||
|
||||
|
@ -111,7 +111,7 @@ ImageHandle::~ImageHandle()
|
|||
|
||||
void ImageHandle::clear()
|
||||
{
|
||||
foreach (const int slot, tile_slots) {
|
||||
foreach (const size_t slot, tile_slots) {
|
||||
manager->remove_image_user(slot);
|
||||
}
|
||||
|
||||
|
@ -165,7 +165,7 @@ vector<int4> ImageHandle::get_svm_slots() const
|
|||
for (size_t i = 0; i < num_nodes; i++) {
|
||||
int4 node;
|
||||
|
||||
int slot = tile_slots[2 * i];
|
||||
size_t slot = tile_slots[2 * i];
|
||||
node.x = manager->images[slot]->loader->get_tile_number();
|
||||
node.y = slot;
|
||||
|
||||
|
@ -387,7 +387,7 @@ void ImageManager::load_image_metadata(Image *img)
|
|||
|
||||
ImageHandle ImageManager::add_image(const string &filename, const ImageParams ¶ms)
|
||||
{
|
||||
const int slot = add_image_slot(new OIIOImageLoader(filename), params, false);
|
||||
const size_t slot = add_image_slot(new OIIOImageLoader(filename), params, false);
|
||||
|
||||
ImageHandle handle;
|
||||
handle.tile_slots.push_back(slot);
|
||||
|
@ -408,13 +408,13 @@ ImageHandle ImageManager::add_image(const string &filename,
|
|||
/* Since we don't have information about the exact tile format used in this code location,
|
||||
* just attempt all replacement patterns that Blender supports. */
|
||||
if (tile != 0) {
|
||||
string_replace(tile_filename, "<UDIM>", string_printf("%04d", tile));
|
||||
string_replace(tile_filename, "<UDIM>", string_printf("%04d", (int)tile));
|
||||
|
||||
int u = ((tile - 1001) % 10);
|
||||
int v = ((tile - 1001) / 10);
|
||||
string_replace(tile_filename, "<UVTILE>", string_printf("u%d_v%d", u + 1, v + 1));
|
||||
}
|
||||
const int slot = add_image_slot(new OIIOImageLoader(tile_filename), params, false);
|
||||
const size_t slot = add_image_slot(new OIIOImageLoader(tile_filename), params, false);
|
||||
handle.tile_slots.push_back(slot);
|
||||
}
|
||||
|
||||
|
@ -425,7 +425,7 @@ ImageHandle ImageManager::add_image(ImageLoader *loader,
|
|||
const ImageParams ¶ms,
|
||||
const bool builtin)
|
||||
{
|
||||
const int slot = add_image_slot(loader, params, builtin);
|
||||
const size_t slot = add_image_slot(loader, params, builtin);
|
||||
|
||||
ImageHandle handle;
|
||||
handle.tile_slots.push_back(slot);
|
||||
|
@ -438,7 +438,7 @@ ImageHandle ImageManager::add_image(const vector<ImageLoader *> &loaders,
|
|||
{
|
||||
ImageHandle handle;
|
||||
for (ImageLoader *loader : loaders) {
|
||||
const int slot = add_image_slot(loader, params, true);
|
||||
const size_t slot = add_image_slot(loader, params, true);
|
||||
handle.tile_slots.push_back(slot);
|
||||
}
|
||||
|
||||
|
@ -446,9 +446,9 @@ ImageHandle ImageManager::add_image(const vector<ImageLoader *> &loaders,
|
|||
return handle;
|
||||
}
|
||||
|
||||
int ImageManager::add_image_slot(ImageLoader *loader,
|
||||
const ImageParams ¶ms,
|
||||
const bool builtin)
|
||||
size_t ImageManager::add_image_slot(ImageLoader *loader,
|
||||
const ImageParams ¶ms,
|
||||
const bool builtin)
|
||||
{
|
||||
Image *img;
|
||||
size_t slot;
|
||||
|
@ -492,7 +492,7 @@ int ImageManager::add_image_slot(ImageLoader *loader,
|
|||
return slot;
|
||||
}
|
||||
|
||||
void ImageManager::add_image_user(int slot)
|
||||
void ImageManager::add_image_user(size_t slot)
|
||||
{
|
||||
thread_scoped_lock device_lock(images_mutex);
|
||||
Image *image = images[slot];
|
||||
|
@ -501,7 +501,7 @@ void ImageManager::add_image_user(int slot)
|
|||
image->users++;
|
||||
}
|
||||
|
||||
void ImageManager::remove_image_user(int slot)
|
||||
void ImageManager::remove_image_user(size_t slot)
|
||||
{
|
||||
thread_scoped_lock device_lock(images_mutex);
|
||||
Image *image = images[slot];
|
||||
|
@ -682,7 +682,7 @@ bool ImageManager::file_load_image(Image *img, int texture_limit)
|
|||
return true;
|
||||
}
|
||||
|
||||
void ImageManager::device_load_image(Device *device, Scene *scene, int slot, Progress *progress)
|
||||
void ImageManager::device_load_image(Device *device, Scene *scene, size_t slot, Progress *progress)
|
||||
{
|
||||
if (progress->get_cancel()) {
|
||||
return;
|
||||
|
@ -698,7 +698,7 @@ void ImageManager::device_load_image(Device *device, Scene *scene, int slot, Pro
|
|||
ImageDataType type = img->metadata.type;
|
||||
|
||||
/* Name for debugging. */
|
||||
img->mem_name = string_printf("tex_image_%s_%03d", name_from_type(type), slot);
|
||||
img->mem_name = string_printf("tex_image_%s_%03d", name_from_type(type), (int)slot);
|
||||
|
||||
/* Free previous texture in slot. */
|
||||
if (img->mem) {
|
||||
|
@ -819,7 +819,7 @@ void ImageManager::device_load_image(Device *device, Scene *scene, int slot, Pro
|
|||
img->need_load = false;
|
||||
}
|
||||
|
||||
void ImageManager::device_free_image(Device *, int slot)
|
||||
void ImageManager::device_free_image(Device *, size_t slot)
|
||||
{
|
||||
Image *img = images[slot];
|
||||
if (img == NULL) {
|
||||
|
@ -874,7 +874,10 @@ void ImageManager::device_update(Device *device, Scene *scene, Progress &progres
|
|||
need_update_ = false;
|
||||
}
|
||||
|
||||
void ImageManager::device_update_slot(Device *device, Scene *scene, int slot, Progress *progress)
|
||||
void ImageManager::device_update_slot(Device *device,
|
||||
Scene *scene,
|
||||
size_t slot,
|
||||
Progress *progress)
|
||||
{
|
||||
Image *img = images[slot];
|
||||
assert(img != NULL);
|
||||
|
|
|
@ -156,7 +156,7 @@ class ImageHandle {
|
|||
ImageManager *get_manager() const;
|
||||
|
||||
protected:
|
||||
vector<int> tile_slots;
|
||||
vector<size_t> tile_slots;
|
||||
ImageManager *manager;
|
||||
|
||||
friend class ImageManager;
|
||||
|
@ -179,7 +179,7 @@ class ImageManager {
|
|||
ImageHandle add_image(const vector<ImageLoader *> &loaders, const ImageParams ¶ms);
|
||||
|
||||
void device_update(Device *device, Scene *scene, Progress &progress);
|
||||
void device_update_slot(Device *device, Scene *scene, int slot, Progress *progress);
|
||||
void device_update_slot(Device *device, Scene *scene, size_t slot, Progress *progress);
|
||||
void device_free(Device *device);
|
||||
|
||||
void device_load_builtin(Device *device, Scene *scene, Progress &progress);
|
||||
|
@ -223,17 +223,17 @@ class ImageManager {
|
|||
vector<Image *> images;
|
||||
void *osl_texture_system;
|
||||
|
||||
int add_image_slot(ImageLoader *loader, const ImageParams ¶ms, const bool builtin);
|
||||
void add_image_user(int slot);
|
||||
void remove_image_user(int slot);
|
||||
size_t add_image_slot(ImageLoader *loader, const ImageParams ¶ms, const bool builtin);
|
||||
void add_image_user(size_t slot);
|
||||
void remove_image_user(size_t slot);
|
||||
|
||||
void load_image_metadata(Image *img);
|
||||
|
||||
template<TypeDesc::BASETYPE FileFormat, typename StorageType>
|
||||
bool file_load_image(Image *img, int texture_limit);
|
||||
|
||||
void device_load_image(Device *device, Scene *scene, int slot, Progress *progress);
|
||||
void device_free_image(Device *device, int slot);
|
||||
void device_load_image(Device *device, Scene *scene, size_t slot, Progress *progress);
|
||||
void device_free_image(Device *device, size_t slot);
|
||||
|
||||
friend class ImageHandle;
|
||||
};
|
||||
|
|
|
@ -264,9 +264,9 @@ void LightManager::device_update_distribution(Device *,
|
|||
|
||||
/* Count emissive triangles. */
|
||||
Mesh *mesh = static_cast<Mesh *>(object->get_geometry());
|
||||
size_t mesh_num_triangles = mesh->num_triangles();
|
||||
int mesh_num_triangles = static_cast<int>(mesh->num_triangles());
|
||||
|
||||
for (size_t i = 0; i < mesh_num_triangles; i++) {
|
||||
for (int i = 0; i < mesh_num_triangles; i++) {
|
||||
int shader_index = mesh->get_shader()[i];
|
||||
Shader *shader = (shader_index < mesh->get_used_shaders().size()) ?
|
||||
static_cast<Shader *>(mesh->get_used_shaders()[shader_index]) :
|
||||
|
|
|
@ -35,7 +35,7 @@ static float3 compute_face_normal(const Mesh::Triangle &t, float3 *verts)
|
|||
/* Fill in coordinates for mesh displacement shader evaluation on device. */
|
||||
static int fill_shader_input(const Scene *scene,
|
||||
const Mesh *mesh,
|
||||
const int object_index,
|
||||
const size_t object_index,
|
||||
device_vector<KernelShaderEvalInput> &d_input)
|
||||
{
|
||||
int d_input_size = 0;
|
||||
|
|
|
@ -40,7 +40,7 @@ ccl_device_inline float half_to_float(half h_in)
|
|||
* unsigned shorts. */
|
||||
class half {
|
||||
public:
|
||||
half() : v(0) {}
|
||||
half() = default;
|
||||
half(const unsigned short &i) : v(i) {}
|
||||
operator unsigned short()
|
||||
{
|
||||
|
|
|
@ -14,62 +14,62 @@ set(INC_SYS
|
|||
)
|
||||
|
||||
set(SRC
|
||||
intern/GHOST_Buttons.cpp
|
||||
intern/GHOST_C-api.cpp
|
||||
intern/GHOST_CallbackEventConsumer.cpp
|
||||
intern/GHOST_Context.cpp
|
||||
intern/GHOST_ContextNone.cpp
|
||||
intern/GHOST_DisplayManager.cpp
|
||||
intern/GHOST_EventManager.cpp
|
||||
intern/GHOST_ISystem.cpp
|
||||
intern/GHOST_ISystemPaths.cpp
|
||||
intern/GHOST_ModifierKeys.cpp
|
||||
intern/GHOST_Path-api.cpp
|
||||
intern/GHOST_PathUtils.cpp
|
||||
intern/GHOST_Rect.cpp
|
||||
intern/GHOST_System.cpp
|
||||
intern/GHOST_TimerManager.cpp
|
||||
intern/GHOST_Window.cpp
|
||||
intern/GHOST_WindowManager.cpp
|
||||
intern/GHOST_Buttons.cc
|
||||
intern/GHOST_C-api.cc
|
||||
intern/GHOST_CallbackEventConsumer.cc
|
||||
intern/GHOST_Context.cc
|
||||
intern/GHOST_ContextNone.cc
|
||||
intern/GHOST_DisplayManager.cc
|
||||
intern/GHOST_EventManager.cc
|
||||
intern/GHOST_ISystem.cc
|
||||
intern/GHOST_ISystemPaths.cc
|
||||
intern/GHOST_ModifierKeys.cc
|
||||
intern/GHOST_Path-api.cc
|
||||
intern/GHOST_PathUtils.cc
|
||||
intern/GHOST_Rect.cc
|
||||
intern/GHOST_System.cc
|
||||
intern/GHOST_TimerManager.cc
|
||||
intern/GHOST_Window.cc
|
||||
intern/GHOST_WindowManager.cc
|
||||
|
||||
GHOST_C-api.h
|
||||
GHOST_IContext.h
|
||||
GHOST_IEvent.h
|
||||
GHOST_IEventConsumer.h
|
||||
GHOST_ISystem.h
|
||||
GHOST_ISystemPaths.h
|
||||
GHOST_ITimerTask.h
|
||||
GHOST_IWindow.h
|
||||
GHOST_Path-api.h
|
||||
GHOST_Rect.h
|
||||
GHOST_IContext.hh
|
||||
GHOST_IEvent.hh
|
||||
GHOST_IEventConsumer.hh
|
||||
GHOST_ISystem.hh
|
||||
GHOST_ISystemPaths.hh
|
||||
GHOST_ITimerTask.hh
|
||||
GHOST_IWindow.hh
|
||||
GHOST_Path-api.hh
|
||||
GHOST_Rect.hh
|
||||
GHOST_Types.h
|
||||
|
||||
intern/GHOST_Buttons.h
|
||||
intern/GHOST_CallbackEventConsumer.h
|
||||
intern/GHOST_Context.h
|
||||
intern/GHOST_ContextNone.h
|
||||
intern/GHOST_Debug.h
|
||||
intern/GHOST_DisplayManager.h
|
||||
intern/GHOST_Event.h
|
||||
intern/GHOST_EventButton.h
|
||||
intern/GHOST_EventCursor.h
|
||||
intern/GHOST_EventDragnDrop.h
|
||||
intern/GHOST_EventKey.h
|
||||
intern/GHOST_EventManager.h
|
||||
intern/GHOST_EventString.h
|
||||
intern/GHOST_EventTrackpad.h
|
||||
intern/GHOST_EventWheel.h
|
||||
intern/GHOST_ModifierKeys.h
|
||||
intern/GHOST_PathUtils.h
|
||||
intern/GHOST_System.h
|
||||
intern/GHOST_SystemPaths.h
|
||||
intern/GHOST_TimerManager.h
|
||||
intern/GHOST_TimerTask.h
|
||||
intern/GHOST_Util.h
|
||||
intern/GHOST_Window.h
|
||||
intern/GHOST_WindowManager.h
|
||||
intern/GHOST_utildefines.h
|
||||
intern/GHOST_utildefines_variadic.h
|
||||
intern/GHOST_Buttons.hh
|
||||
intern/GHOST_CallbackEventConsumer.hh
|
||||
intern/GHOST_Context.hh
|
||||
intern/GHOST_ContextNone.hh
|
||||
intern/GHOST_Debug.hh
|
||||
intern/GHOST_DisplayManager.hh
|
||||
intern/GHOST_Event.hh
|
||||
intern/GHOST_EventButton.hh
|
||||
intern/GHOST_EventCursor.hh
|
||||
intern/GHOST_EventDragnDrop.hh
|
||||
intern/GHOST_EventKey.hh
|
||||
intern/GHOST_EventManager.hh
|
||||
intern/GHOST_EventString.hh
|
||||
intern/GHOST_EventTrackpad.hh
|
||||
intern/GHOST_EventWheel.hh
|
||||
intern/GHOST_ModifierKeys.hh
|
||||
intern/GHOST_PathUtils.hh
|
||||
intern/GHOST_System.hh
|
||||
intern/GHOST_SystemPaths.hh
|
||||
intern/GHOST_TimerManager.hh
|
||||
intern/GHOST_TimerTask.hh
|
||||
intern/GHOST_Util.hh
|
||||
intern/GHOST_Window.hh
|
||||
intern/GHOST_WindowManager.hh
|
||||
intern/GHOST_utildefines.hh
|
||||
intern/GHOST_utildefines_variadic.hh
|
||||
)
|
||||
|
||||
set(LIB
|
||||
|
@ -78,9 +78,9 @@ set(LIB
|
|||
|
||||
if(WITH_VULKAN_BACKEND)
|
||||
list(APPEND SRC
|
||||
intern/GHOST_ContextVK.cpp
|
||||
intern/GHOST_ContextVK.cc
|
||||
|
||||
intern/GHOST_ContextVK.h
|
||||
intern/GHOST_ContextVK.hh
|
||||
)
|
||||
|
||||
list(APPEND INC_SYS
|
||||
|
@ -98,9 +98,9 @@ endif()
|
|||
|
||||
if(WITH_GHOST_DEBUG)
|
||||
list(APPEND SRC
|
||||
intern/GHOST_EventPrinter.cpp
|
||||
intern/GHOST_EventPrinter.cc
|
||||
|
||||
intern/GHOST_EventPrinter.h
|
||||
intern/GHOST_EventPrinter.hh
|
||||
)
|
||||
add_definitions(-DWITH_GHOST_DEBUG)
|
||||
endif()
|
||||
|
@ -109,10 +109,10 @@ if(WITH_INPUT_NDOF)
|
|||
add_definitions(-DWITH_INPUT_NDOF)
|
||||
|
||||
list(APPEND SRC
|
||||
intern/GHOST_NDOFManager.cpp
|
||||
intern/GHOST_NDOFManager.cc
|
||||
|
||||
intern/GHOST_EventNDOF.h
|
||||
intern/GHOST_NDOFManager.h
|
||||
intern/GHOST_EventNDOF.hh
|
||||
intern/GHOST_NDOFManager.hh
|
||||
)
|
||||
|
||||
list(APPEND INC_SYS
|
||||
|
@ -124,24 +124,24 @@ if(WITH_INPUT_NDOF)
|
|||
endif()
|
||||
|
||||
list(APPEND SRC
|
||||
intern/GHOST_DisplayManagerNULL.h
|
||||
intern/GHOST_SystemHeadless.h
|
||||
intern/GHOST_WindowNULL.h
|
||||
intern/GHOST_DisplayManagerNULL.hh
|
||||
intern/GHOST_SystemHeadless.hh
|
||||
intern/GHOST_WindowNULL.hh
|
||||
)
|
||||
|
||||
if(WITH_HEADLESS)
|
||||
add_definitions(-DWITH_HEADLESS)
|
||||
elseif(WITH_GHOST_SDL)
|
||||
list(APPEND SRC
|
||||
intern/GHOST_ContextSDL.cpp
|
||||
intern/GHOST_DisplayManagerSDL.cpp
|
||||
intern/GHOST_SystemSDL.cpp
|
||||
intern/GHOST_WindowSDL.cpp
|
||||
intern/GHOST_ContextSDL.cc
|
||||
intern/GHOST_DisplayManagerSDL.cc
|
||||
intern/GHOST_SystemSDL.cc
|
||||
intern/GHOST_WindowSDL.cc
|
||||
|
||||
intern/GHOST_ContextSDL.h
|
||||
intern/GHOST_DisplayManagerSDL.h
|
||||
intern/GHOST_SystemSDL.h
|
||||
intern/GHOST_WindowSDL.h
|
||||
intern/GHOST_ContextSDL.hh
|
||||
intern/GHOST_DisplayManagerSDL.hh
|
||||
intern/GHOST_SystemSDL.hh
|
||||
intern/GHOST_WindowSDL.hh
|
||||
)
|
||||
add_definitions(-DWITH_GHOST_SDL)
|
||||
|
||||
|
@ -167,23 +167,23 @@ elseif(APPLE AND NOT WITH_GHOST_X11)
|
|||
intern/GHOST_SystemCocoa.mm
|
||||
intern/GHOST_WindowCocoa.mm
|
||||
|
||||
intern/GHOST_DisplayManagerCocoa.h
|
||||
intern/GHOST_SystemCocoa.h
|
||||
intern/GHOST_WindowCocoa.h
|
||||
intern/GHOST_WindowViewCocoa.h
|
||||
intern/GHOST_DisplayManagerCocoa.hh
|
||||
intern/GHOST_SystemCocoa.hh
|
||||
intern/GHOST_WindowCocoa.hh
|
||||
intern/GHOST_WindowViewCocoa.hh
|
||||
)
|
||||
|
||||
list(APPEND SRC
|
||||
intern/GHOST_ContextCGL.mm
|
||||
|
||||
intern/GHOST_ContextCGL.h
|
||||
intern/GHOST_ContextCGL.hh
|
||||
)
|
||||
|
||||
if(WITH_INPUT_NDOF)
|
||||
list(APPEND SRC
|
||||
intern/GHOST_NDOFManagerCocoa.mm
|
||||
|
||||
intern/GHOST_NDOFManagerCocoa.h
|
||||
intern/GHOST_NDOFManagerCocoa.hh
|
||||
)
|
||||
endif()
|
||||
|
||||
|
@ -199,22 +199,22 @@ elseif(WITH_GHOST_X11 OR WITH_GHOST_WAYLAND)
|
|||
)
|
||||
|
||||
list(APPEND SRC
|
||||
intern/GHOST_DisplayManagerX11.cpp
|
||||
intern/GHOST_SystemX11.cpp
|
||||
intern/GHOST_TaskbarX11.cpp
|
||||
intern/GHOST_WindowX11.cpp
|
||||
intern/GHOST_DisplayManagerX11.cc
|
||||
intern/GHOST_SystemX11.cc
|
||||
intern/GHOST_TaskbarX11.cc
|
||||
intern/GHOST_WindowX11.cc
|
||||
|
||||
intern/GHOST_DisplayManagerX11.h
|
||||
intern/GHOST_IconX11.h
|
||||
intern/GHOST_SystemX11.h
|
||||
intern/GHOST_TaskbarX11.h
|
||||
intern/GHOST_WindowX11.h
|
||||
intern/GHOST_DisplayManagerX11.hh
|
||||
intern/GHOST_IconX11.hh
|
||||
intern/GHOST_SystemX11.hh
|
||||
intern/GHOST_TaskbarX11.hh
|
||||
intern/GHOST_WindowX11.hh
|
||||
)
|
||||
|
||||
list(APPEND SRC
|
||||
intern/GHOST_ContextGLX.cpp
|
||||
intern/GHOST_ContextGLX.cc
|
||||
|
||||
intern/GHOST_ContextGLX.h
|
||||
intern/GHOST_ContextGLX.hh
|
||||
)
|
||||
|
||||
if(WITH_GHOST_XDND)
|
||||
|
@ -229,9 +229,9 @@ elseif(WITH_GHOST_X11 OR WITH_GHOST_WAYLAND)
|
|||
)
|
||||
|
||||
list(APPEND SRC
|
||||
intern/GHOST_DropTargetX11.cpp
|
||||
intern/GHOST_DropTargetX11.cc
|
||||
|
||||
intern/GHOST_DropTargetX11.h
|
||||
intern/GHOST_DropTargetX11.hh
|
||||
)
|
||||
endif()
|
||||
|
||||
|
@ -336,13 +336,13 @@ elseif(WITH_GHOST_X11 OR WITH_GHOST_WAYLAND)
|
|||
endif()
|
||||
|
||||
list(APPEND SRC
|
||||
intern/GHOST_SystemWayland.cpp
|
||||
intern/GHOST_WindowWayland.cpp
|
||||
intern/GHOST_SystemWayland.cc
|
||||
intern/GHOST_WindowWayland.cc
|
||||
|
||||
intern/GHOST_SystemWayland.h
|
||||
intern/GHOST_WaylandCursorSettings.h
|
||||
intern/GHOST_WaylandUtils.h
|
||||
intern/GHOST_WindowWayland.h
|
||||
intern/GHOST_SystemWayland.hh
|
||||
intern/GHOST_WaylandCursorSettings.hh
|
||||
intern/GHOST_WaylandUtils.hh
|
||||
intern/GHOST_WindowWayland.hh
|
||||
)
|
||||
|
||||
set(INC_DST ${CMAKE_CURRENT_BINARY_DIR}/libwayland)
|
||||
|
@ -441,9 +441,9 @@ elseif(WITH_GHOST_X11 OR WITH_GHOST_WAYLAND)
|
|||
|
||||
if(WITH_INPUT_NDOF)
|
||||
list(APPEND SRC
|
||||
intern/GHOST_NDOFManagerUnix.cpp
|
||||
intern/GHOST_NDOFManagerUnix.cc
|
||||
|
||||
intern/GHOST_NDOFManagerUnix.h
|
||||
intern/GHOST_NDOFManagerUnix.hh
|
||||
)
|
||||
endif()
|
||||
|
||||
|
@ -463,67 +463,67 @@ elseif(WIN32)
|
|||
)
|
||||
|
||||
list(APPEND SRC
|
||||
intern/GHOST_ContextD3D.cpp
|
||||
intern/GHOST_DisplayManagerWin32.cpp
|
||||
intern/GHOST_DropTargetWin32.cpp
|
||||
intern/GHOST_SystemWin32.cpp
|
||||
intern/GHOST_TrackpadWin32.cpp
|
||||
intern/GHOST_WindowWin32.cpp
|
||||
intern/GHOST_Wintab.cpp
|
||||
intern/GHOST_ContextD3D.cc
|
||||
intern/GHOST_DisplayManagerWin32.cc
|
||||
intern/GHOST_DropTargetWin32.cc
|
||||
intern/GHOST_SystemWin32.cc
|
||||
intern/GHOST_TrackpadWin32.cc
|
||||
intern/GHOST_WindowWin32.cc
|
||||
intern/GHOST_Wintab.cc
|
||||
|
||||
intern/GHOST_ContextD3D.h
|
||||
intern/GHOST_DisplayManagerWin32.h
|
||||
intern/GHOST_DropTargetWin32.h
|
||||
intern/GHOST_SystemWin32.h
|
||||
intern/GHOST_TaskbarWin32.h
|
||||
intern/GHOST_TrackpadWin32.h
|
||||
intern/GHOST_WindowWin32.h
|
||||
intern/GHOST_Wintab.h
|
||||
intern/GHOST_ContextD3D.hh
|
||||
intern/GHOST_DisplayManagerWin32.hh
|
||||
intern/GHOST_DropTargetWin32.hh
|
||||
intern/GHOST_SystemWin32.hh
|
||||
intern/GHOST_TaskbarWin32.hh
|
||||
intern/GHOST_TrackpadWin32.hh
|
||||
intern/GHOST_WindowWin32.hh
|
||||
intern/GHOST_Wintab.hh
|
||||
)
|
||||
|
||||
list(APPEND SRC
|
||||
intern/GHOST_ContextWGL.cpp
|
||||
intern/GHOST_ContextWGL.cc
|
||||
|
||||
intern/GHOST_ContextWGL.h
|
||||
intern/GHOST_ContextWGL.hh
|
||||
)
|
||||
|
||||
if(WITH_INPUT_IME)
|
||||
add_definitions(-DWITH_INPUT_IME)
|
||||
|
||||
list(APPEND SRC
|
||||
intern/GHOST_ImeWin32.cpp
|
||||
intern/GHOST_ImeWin32.cc
|
||||
|
||||
intern/GHOST_ImeWin32.h
|
||||
intern/GHOST_ImeWin32.hh
|
||||
)
|
||||
endif()
|
||||
|
||||
if(WITH_INPUT_NDOF)
|
||||
list(APPEND SRC
|
||||
intern/GHOST_NDOFManagerWin32.cpp
|
||||
intern/GHOST_NDOFManagerWin32.cc
|
||||
|
||||
intern/GHOST_NDOFManagerWin32.h
|
||||
intern/GHOST_NDOFManagerWin32.hh
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
list(APPEND SRC
|
||||
intern/GHOST_ContextEGL.cpp
|
||||
intern/GHOST_ContextEGL.cc
|
||||
|
||||
intern/GHOST_ContextEGL.h
|
||||
intern/GHOST_ContextEGL.hh
|
||||
)
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
list(APPEND SRC
|
||||
intern/GHOST_SystemPathsCocoa.h
|
||||
intern/GHOST_SystemPathsCocoa.hh
|
||||
intern/GHOST_SystemPathsCocoa.mm
|
||||
)
|
||||
|
||||
elseif(UNIX)
|
||||
list(APPEND SRC
|
||||
intern/GHOST_SystemPathsUnix.cpp
|
||||
intern/GHOST_SystemPathsUnix.h
|
||||
intern/GHOST_SystemPathsUnix.cc
|
||||
intern/GHOST_SystemPathsUnix.hh
|
||||
)
|
||||
|
||||
if(NOT WITH_INSTALL_PORTABLE)
|
||||
|
@ -532,8 +532,8 @@ elseif(UNIX)
|
|||
|
||||
elseif(WIN32)
|
||||
list(APPEND SRC
|
||||
intern/GHOST_SystemPathsWin32.cpp
|
||||
intern/GHOST_SystemPathsWin32.h
|
||||
intern/GHOST_SystemPathsWin32.cc
|
||||
intern/GHOST_SystemPathsWin32.hh
|
||||
)
|
||||
|
||||
list(APPEND INC
|
||||
|
@ -544,25 +544,25 @@ endif()
|
|||
|
||||
if(WITH_XR_OPENXR)
|
||||
list(APPEND SRC
|
||||
intern/GHOST_Xr.cpp
|
||||
intern/GHOST_XrAction.cpp
|
||||
intern/GHOST_XrContext.cpp
|
||||
intern/GHOST_XrControllerModel.cpp
|
||||
intern/GHOST_XrEvent.cpp
|
||||
intern/GHOST_XrGraphicsBinding.cpp
|
||||
intern/GHOST_XrSession.cpp
|
||||
intern/GHOST_XrSwapchain.cpp
|
||||
intern/GHOST_Xr.cc
|
||||
intern/GHOST_XrAction.cc
|
||||
intern/GHOST_XrContext.cc
|
||||
intern/GHOST_XrControllerModel.cc
|
||||
intern/GHOST_XrEvent.cc
|
||||
intern/GHOST_XrGraphicsBinding.cc
|
||||
intern/GHOST_XrSession.cc
|
||||
intern/GHOST_XrSwapchain.cc
|
||||
|
||||
GHOST_IXrContext.h
|
||||
intern/GHOST_IXrGraphicsBinding.h
|
||||
intern/GHOST_XrAction.h
|
||||
intern/GHOST_XrContext.h
|
||||
intern/GHOST_XrControllerModel.h
|
||||
intern/GHOST_XrException.h
|
||||
intern/GHOST_XrSession.h
|
||||
intern/GHOST_XrSwapchain.h
|
||||
intern/GHOST_Xr_intern.h
|
||||
intern/GHOST_Xr_openxr_includes.h
|
||||
GHOST_IXrContext.hh
|
||||
intern/GHOST_IXrGraphicsBinding.hh
|
||||
intern/GHOST_XrAction.hh
|
||||
intern/GHOST_XrContext.hh
|
||||
intern/GHOST_XrControllerModel.hh
|
||||
intern/GHOST_XrException.hh
|
||||
intern/GHOST_XrSession.hh
|
||||
intern/GHOST_XrSwapchain.hh
|
||||
intern/GHOST_Xr_intern.hh
|
||||
intern/GHOST_Xr_openxr_includes.hh
|
||||
|
||||
# Header only library.
|
||||
../../extern/tinygltf/tiny_gltf.h
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "GHOST_IEvent.h"
|
||||
#include "GHOST_IEvent.hh"
|
||||
|
||||
/**
|
||||
* Interface class for objects interested in receiving events.
|
|
@ -12,9 +12,9 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "GHOST_IContext.h"
|
||||
#include "GHOST_ITimerTask.h"
|
||||
#include "GHOST_IWindow.h"
|
||||
#include "GHOST_IContext.hh"
|
||||
#include "GHOST_ITimerTask.hh"
|
||||
#include "GHOST_IWindow.hh"
|
||||
#include "GHOST_Types.h"
|
||||
|
||||
class GHOST_IEventConsumer;
|
||||
|
@ -77,12 +77,12 @@ class GHOST_IEventConsumer;
|
|||
*
|
||||
* \subsection cplusplus_api The C++ API consists of the following files:
|
||||
*
|
||||
* - GHOST_IEvent.h
|
||||
* - GHOST_IEventConsumer.h
|
||||
* - GHOST_ISystem.h
|
||||
* - GHOST_ITimerTask.h
|
||||
* - GHOST_IWindow.h
|
||||
* - GHOST_Rect.h
|
||||
* - GHOST_IEvent.hh
|
||||
* - GHOST_IEventConsumer.hh
|
||||
* - GHOST_ISystem.hh
|
||||
* - GHOST_ITimerTask.hh
|
||||
* - GHOST_IWindow.hh
|
||||
* - GHOST_Rect.hh
|
||||
* - GHOST_Types.h
|
||||
*
|
||||
* For an example of using the C++-API, have a look at the GHOST_C-Test.cpp
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "GHOST_Rect.h"
|
||||
#include "GHOST_Rect.hh"
|
||||
#include "GHOST_Types.h"
|
||||
|
||||
#include <stdlib.h>
|
|
@ -5,7 +5,7 @@
|
|||
* \ingroup GHOST
|
||||
*/
|
||||
|
||||
#include "GHOST_Buttons.h"
|
||||
#include "GHOST_Buttons.hh"
|
||||
|
||||
GHOST_Buttons::GHOST_Buttons()
|
||||
{
|
|
@ -11,16 +11,16 @@
|
|||
#include <cstring>
|
||||
|
||||
#include "GHOST_C-api.h"
|
||||
#include "GHOST_IEvent.h"
|
||||
#include "GHOST_IEventConsumer.h"
|
||||
#include "GHOST_ISystem.h"
|
||||
#include "intern/GHOST_Debug.h"
|
||||
#include "GHOST_IEvent.hh"
|
||||
#include "GHOST_IEventConsumer.hh"
|
||||
#include "GHOST_ISystem.hh"
|
||||
#include "intern/GHOST_Debug.hh"
|
||||
#ifdef WITH_XR_OPENXR
|
||||
# include "GHOST_IXrContext.h"
|
||||
# include "intern/GHOST_XrSession.h"
|
||||
# include "GHOST_IXrContext.hh"
|
||||
# include "intern/GHOST_XrSession.hh"
|
||||
#endif
|
||||
#include "intern/GHOST_CallbackEventConsumer.h"
|
||||
#include "intern/GHOST_XrException.h"
|
||||
#include "intern/GHOST_CallbackEventConsumer.hh"
|
||||
#include "intern/GHOST_XrException.hh"
|
||||
|
||||
GHOST_SystemHandle GHOST_CreateSystem(void)
|
||||
{
|
|
@ -9,9 +9,9 @@
|
|||
* Copyright (C) 2001 NaN Technologies B.V.
|
||||
*/
|
||||
|
||||
#include "GHOST_CallbackEventConsumer.h"
|
||||
#include "GHOST_CallbackEventConsumer.hh"
|
||||
#include "GHOST_C-api.h"
|
||||
#include "GHOST_Debug.h"
|
||||
#include "GHOST_Debug.hh"
|
||||
|
||||
GHOST_CallbackEventConsumer::GHOST_CallbackEventConsumer(GHOST_EventCallbackProcPtr eventCallback,
|
||||
GHOST_TUserDataPtr userData)
|
|
@ -9,7 +9,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "GHOST_C-api.h"
|
||||
#include "GHOST_IEventConsumer.h"
|
||||
#include "GHOST_IEventConsumer.hh"
|
||||
|
||||
/**
|
||||
* Event consumer that will forward events to a call-back routine.
|
|
@ -7,7 +7,7 @@
|
|||
* Definition of GHOST_Context class.
|
||||
*/
|
||||
|
||||
#include "GHOST_Context.h"
|
||||
#include "GHOST_Context.hh"
|
||||
|
||||
#ifdef _WIN32
|
||||
# include <epoxy/wgl.h>
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "GHOST_IContext.h"
|
||||
#include "GHOST_IContext.hh"
|
||||
#include "GHOST_Types.h"
|
||||
|
||||
#include <epoxy/gl.h>
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "GHOST_Context.h"
|
||||
#include "GHOST_Context.hh"
|
||||
|
||||
#include <Cocoa/Cocoa.h>
|
||||
#include <Metal/Metal.h>
|
|
@ -13,7 +13,7 @@
|
|||
# pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
|
||||
#include "GHOST_ContextCGL.h"
|
||||
#include "GHOST_ContextCGL.hh"
|
||||
|
||||
#include <Cocoa/Cocoa.h>
|
||||
#include <Metal/Metal.h>
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
|
||||
#include <epoxy/wgl.h>
|
||||
|
||||
#include "GHOST_ContextD3D.h"
|
||||
#include "GHOST_ContextWGL.h" /* For shared drawing */
|
||||
#include "GHOST_ContextD3D.hh"
|
||||
#include "GHOST_ContextWGL.hh" /* For shared drawing */
|
||||
|
||||
HMODULE GHOST_ContextD3D::s_d3d_lib = NULL;
|
||||
PFN_D3D11_CREATE_DEVICE GHOST_ContextD3D::s_D3D11CreateDeviceFn = NULL;
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
#include <D3D11.h>
|
||||
|
||||
#include "GHOST_Context.h"
|
||||
#include "GHOST_Context.hh"
|
||||
|
||||
class GHOST_ContextD3D : public GHOST_Context {
|
||||
/* XR code needs low level graphics data to send to OpenXR. */
|
|
@ -7,7 +7,7 @@
|
|||
* Definition of GHOST_ContextEGL class.
|
||||
*/
|
||||
|
||||
#include "GHOST_ContextEGL.h"
|
||||
#include "GHOST_ContextEGL.hh"
|
||||
|
||||
#include <set>
|
||||
#include <sstream>
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "GHOST_Context.h"
|
||||
#include "GHOST_System.h"
|
||||
#include "GHOST_Context.hh"
|
||||
#include "GHOST_System.hh"
|
||||
|
||||
#include <epoxy/egl.h>
|
||||
#include <epoxy/gl.h>
|
|
@ -7,8 +7,8 @@
|
|||
* Definition of GHOST_ContextGLX class.
|
||||
*/
|
||||
|
||||
#include "GHOST_ContextGLX.h"
|
||||
#include "GHOST_SystemX11.h"
|
||||
#include "GHOST_ContextGLX.hh"
|
||||
#include "GHOST_SystemX11.hh"
|
||||
|
||||
#include <vector>
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "GHOST_Context.h"
|
||||
#include "GHOST_Context.hh"
|
||||
|
||||
#include <epoxy/glx.h>
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
* Definition of GHOST_ContextNone class.
|
||||
*/
|
||||
|
||||
#include "GHOST_ContextNone.h"
|
||||
#include "GHOST_ContextNone.hh"
|
||||
|
||||
GHOST_TSuccess GHOST_ContextNone::swapBuffers()
|
||||
{
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "GHOST_Context.h"
|
||||
#include "GHOST_Context.hh"
|
||||
|
||||
class GHOST_ContextNone : public GHOST_Context {
|
||||
public:
|
|
@ -7,7 +7,7 @@
|
|||
* Definition of GHOST_ContextSDL class.
|
||||
*/
|
||||
|
||||
#include "GHOST_ContextSDL.h"
|
||||
#include "GHOST_ContextSDL.hh"
|
||||
|
||||
#include <vector>
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "GHOST_Context.h"
|
||||
#include "GHOST_Context.hh"
|
||||
|
||||
extern "C" {
|
||||
#include "SDL.h"
|
|
@ -4,7 +4,7 @@
|
|||
* \ingroup GHOST
|
||||
*/
|
||||
|
||||
#include "GHOST_ContextVK.h"
|
||||
#include "GHOST_ContextVK.hh"
|
||||
|
||||
#ifdef _WIN32
|
||||
# include <vulkan/vulkan_win32.h>
|
|
@ -6,16 +6,16 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "GHOST_Context.h"
|
||||
#include "GHOST_Context.hh"
|
||||
|
||||
#ifdef _WIN32
|
||||
# include "GHOST_SystemWin32.h"
|
||||
# include "GHOST_SystemWin32.hh"
|
||||
#elif defined(__APPLE__)
|
||||
# include "GHOST_SystemCocoa.h"
|
||||
# include "GHOST_SystemCocoa.hh"
|
||||
#else
|
||||
# include "GHOST_SystemX11.h"
|
||||
# include "GHOST_SystemX11.hh"
|
||||
# ifdef WITH_GHOST_WAYLAND
|
||||
# include "GHOST_SystemWayland.h"
|
||||
# include "GHOST_SystemWayland.hh"
|
||||
# else
|
||||
# define wl_surface void
|
||||
# define wl_display void
|
|
@ -7,7 +7,7 @@
|
|||
* Definition of GHOST_ContextWGL class.
|
||||
*/
|
||||
|
||||
#include "GHOST_ContextWGL.h"
|
||||
#include "GHOST_ContextWGL.hh"
|
||||
|
||||
#include <tchar.h>
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
//#define WIN32_COMPOSITING
|
||||
|
||||
#include "GHOST_Context.h"
|
||||
#include "GHOST_Context.hh"
|
||||
|
||||
#include <epoxy/wgl.h>
|
||||
|
|
@ -9,8 +9,8 @@
|
|||
* Copyright (C) 2001 NaN Technologies B.V.
|
||||
*/
|
||||
|
||||
#include "GHOST_DisplayManager.h"
|
||||
#include "GHOST_Debug.h"
|
||||
#include "GHOST_DisplayManager.hh"
|
||||
#include "GHOST_Debug.hh"
|
||||
|
||||
GHOST_DisplayManager::GHOST_DisplayManager() : m_settingsInitialized(false) {}
|
||||
|
|
@ -12,7 +12,7 @@
|
|||
# error Apple only!
|
||||
#endif // __APPLE__
|
||||
|
||||
#include "GHOST_DisplayManager.h"
|
||||
#include "GHOST_DisplayManager.hh"
|
||||
|
||||
/**
|
||||
* Manages system displays (Mac OSX/Cocoa implementation).
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
#include <Cocoa/Cocoa.h>
|
||||
|
||||
#include "GHOST_Debug.h"
|
||||
#include "GHOST_DisplayManagerCocoa.h"
|
||||
#include "GHOST_Debug.hh"
|
||||
#include "GHOST_DisplayManagerCocoa.hh"
|
||||
|
||||
// We do not support multiple monitors at the moment
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "GHOST_DisplayManager.h"
|
||||
#include "GHOST_SystemHeadless.h"
|
||||
#include "GHOST_DisplayManager.hh"
|
||||
#include "GHOST_SystemHeadless.hh"
|
||||
|
||||
class GHOST_SystemHeadless;
|
||||
|
|
@ -8,10 +8,10 @@
|
|||
* \ingroup GHOST
|
||||
*/
|
||||
|
||||
#include "GHOST_DisplayManagerSDL.h"
|
||||
#include "GHOST_SystemSDL.h"
|
||||
#include "GHOST_DisplayManagerSDL.hh"
|
||||
#include "GHOST_SystemSDL.hh"
|
||||
|
||||
#include "GHOST_WindowManager.h"
|
||||
#include "GHOST_WindowManager.hh"
|
||||
|
||||
GHOST_DisplayManagerSDL::GHOST_DisplayManagerSDL(GHOST_SystemSDL *system)
|
||||
: GHOST_DisplayManager(), m_system(system)
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "GHOST_DisplayManager.h"
|
||||
#include "GHOST_DisplayManager.hh"
|
||||
|
||||
extern "C" {
|
||||
#include "SDL.h"
|
|
@ -5,8 +5,8 @@
|
|||
* \ingroup GHOST
|
||||
*/
|
||||
|
||||
#include "GHOST_DisplayManagerWin32.h"
|
||||
#include "GHOST_Debug.h"
|
||||
#include "GHOST_DisplayManagerWin32.hh"
|
||||
#include "GHOST_Debug.hh"
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
|
@ -12,7 +12,7 @@
|
|||
# error WIN32 only!
|
||||
#endif // WIN32
|
||||
|
||||
#include "GHOST_DisplayManager.h"
|
||||
#include "GHOST_DisplayManager.hh"
|
||||
|
||||
/**
|
||||
* Manages system displays (WIN32 implementation).
|
|
@ -14,8 +14,8 @@
|
|||
# include <X11/extensions/xf86vmode.h>
|
||||
#endif
|
||||
|
||||
#include "GHOST_DisplayManagerX11.h"
|
||||
#include "GHOST_SystemX11.h"
|
||||
#include "GHOST_DisplayManagerX11.hh"
|
||||
#include "GHOST_SystemX11.hh"
|
||||
|
||||
GHOST_DisplayManagerX11::GHOST_DisplayManagerX11(GHOST_SystemX11 *system)
|
||||
: GHOST_DisplayManager(), m_system(system)
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "GHOST_DisplayManager.h"
|
||||
#include "GHOST_DisplayManager.hh"
|
||||
|
||||
class GHOST_SystemX11;
|
||||
|
|
@ -5,8 +5,8 @@
|
|||
* \ingroup GHOST
|
||||
*/
|
||||
|
||||
#include "GHOST_DropTargetWin32.h"
|
||||
#include "GHOST_Debug.h"
|
||||
#include "GHOST_DropTargetWin32.hh"
|
||||
#include "GHOST_Debug.hh"
|
||||
#include <shellapi.h>
|
||||
|
||||
#include "utf_winfunc.h"
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "GHOST_SystemWin32.h"
|
||||
#include "GHOST_WindowWin32.h"
|
||||
#include "GHOST_SystemWin32.hh"
|
||||
#include "GHOST_WindowWin32.hh"
|
||||
#include <GHOST_Types.h>
|
||||
#include <string.h>
|
||||
|
|
@ -5,10 +5,10 @@
|
|||
* \ingroup GHOST
|
||||
*/
|
||||
|
||||
#include "GHOST_DropTargetX11.h"
|
||||
#include "GHOST_Debug.h"
|
||||
#include "GHOST_PathUtils.h"
|
||||
#include "GHOST_utildefines.h"
|
||||
#include "GHOST_DropTargetX11.hh"
|
||||
#include "GHOST_Debug.hh"
|
||||
#include "GHOST_PathUtils.hh"
|
||||
#include "GHOST_utildefines.hh"
|
||||
|
||||
#include <cassert>
|
||||
#include <cctype>
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "GHOST_SystemX11.h"
|
||||
#include "GHOST_WindowX11.h"
|
||||
#include "GHOST_SystemX11.hh"
|
||||
#include "GHOST_WindowX11.hh"
|
||||
#include <GHOST_Types.h>
|
||||
|
||||
#include "xdnd.h"
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "GHOST_IEvent.h"
|
||||
#include "GHOST_IEvent.hh"
|
||||
|
||||
/**
|
||||
* Base class for events received the operating system.
|
|
@ -8,8 +8,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "GHOST_Event.h"
|
||||
#include "GHOST_Window.h"
|
||||
#include "GHOST_Event.hh"
|
||||
#include "GHOST_Window.hh"
|
||||
|
||||
/**
|
||||
* Mouse button event.
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "GHOST_Event.h"
|
||||
#include "GHOST_Event.hh"
|
||||
|
||||
/**
|
||||
* Cursor event.
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "GHOST_Event.h"
|
||||
#include "GHOST_Event.hh"
|
||||
extern "C" {
|
||||
#include "IMB_imbuf.h"
|
||||
#include "IMB_imbuf_types.h"
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
#include <string.h>
|
||||
|
||||
#include "GHOST_Event.h"
|
||||
#include "GHOST_Event.hh"
|
||||
|
||||
/**
|
||||
* Key event.
|
|
@ -9,8 +9,8 @@
|
|||
* Copyright (C) 2001 NaN Technologies B.V.
|
||||
*/
|
||||
|
||||
#include "GHOST_EventManager.h"
|
||||
#include "GHOST_Debug.h"
|
||||
#include "GHOST_EventManager.hh"
|
||||
#include "GHOST_Debug.hh"
|
||||
#include <algorithm>
|
||||
|
||||
GHOST_EventManager::GHOST_EventManager() {}
|
|
@ -11,7 +11,7 @@
|
|||
#include <deque>
|
||||
#include <vector>
|
||||
|
||||
#include "GHOST_IEventConsumer.h"
|
||||
#include "GHOST_IEventConsumer.hh"
|
||||
|
||||
/**
|
||||
* Manages an event stack and a list of event consumers.
|
|
@ -10,7 +10,7 @@
|
|||
# error NDOF code included in non-NDOF-enabled build
|
||||
#endif
|
||||
|
||||
#include "GHOST_Event.h"
|
||||
#include "GHOST_Event.hh"
|
||||
|
||||
class GHOST_EventNDOFMotion : public GHOST_Event {
|
||||
protected:
|
|
@ -6,10 +6,10 @@
|
|||
* Declaration of GHOST_EventPrinter class.
|
||||
*/
|
||||
|
||||
#include "GHOST_EventPrinter.h"
|
||||
#include "GHOST_Debug.h"
|
||||
#include "GHOST_EventDragnDrop.h"
|
||||
#include "GHOST_EventKey.h"
|
||||
#include "GHOST_EventPrinter.hh"
|
||||
#include "GHOST_Debug.hh"
|
||||
#include "GHOST_EventDragnDrop.hh"
|
||||
#include "GHOST_EventKey.hh"
|
||||
#include <iostream>
|
||||
|
||||
#include <cstdio>
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "GHOST_IEventConsumer.h"
|
||||
#include "GHOST_IEventConsumer.hh"
|
||||
|
||||
/**
|
||||
* An Event consumer that prints all the events to standard out.
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "GHOST_Event.h"
|
||||
#include "GHOST_Event.hh"
|
||||
|
||||
/**
|
||||
* Generic class for events with string data
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "GHOST_Event.h"
|
||||
#include "GHOST_Event.hh"
|
||||
|
||||
/**
|
||||
* Trackpad (scroll, magnify, rotate, ...) event.
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue